Compare commits
3 Commits
master
...
5143_api기능
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d99219a559 | ||
|
|
8b5c838faa | ||
|
|
a0b38fa00e |
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
|
||||
64
pom.xml
64
pom.xml
@ -54,8 +54,18 @@
|
||||
|
||||
<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>
|
||||
@ -63,6 +73,22 @@
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>egovframe2</id>
|
||||
<url>http://maven.egovframe.kr:8080/maven/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<!-- Komoran 형태소분석기 -->
|
||||
<repository>
|
||||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
<!-- Komoran 형태소분석기 -->
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
@ -146,7 +172,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 +503,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>
|
||||
|
||||
|
||||
@ -549,28 +568,7 @@
|
||||
<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,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;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -318,17 +318,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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -229,8 +229,8 @@ public final class MsgSendUtils {
|
||||
placeholders.put("[*4*]", MjonMsgSendVO::getRep4);
|
||||
|
||||
boolean hasPerformedSpamCheck = false; // 치환 문자가 없는 경우, 스팸 체크가 한 번만 수행되도록 제어
|
||||
boolean hasPerformedMsgType = false; // 치환 문자가 없는 경우, 메세지 타입 체크 한번
|
||||
boolean hasPerformedDelayYn = false; // 치환 문자가 없는 경우,
|
||||
boolean hasPerformedMsgType = false; // 치환 문자가 없는 경우, 스팸 체크가 한 번만 수행되도록 제어
|
||||
boolean hasPerformedDelayYn = false; // 치환 문자가 없는 경우, 스팸 체크가 한 번만 수행되도록 제어
|
||||
|
||||
String msgKind = mjonMsgVO.getMsgKind();
|
||||
String smsTxtTemp = mjonMsgVO.getSmsTxt();
|
||||
@ -257,10 +257,13 @@ public final class MsgSendUtils {
|
||||
for (Map.Entry<String, Function<MjonMsgSendVO, String>> entry : placeholders.entrySet()) {
|
||||
String placeholder = entry.getKey();
|
||||
String value = entry.getValue().apply(sendVO);
|
||||
// log.info(" + smsTxtTemp [{}]", smsTxtTemp);
|
||||
// log.info(" + placeholder [{}]", placeholder);
|
||||
// log.info(" + value [{}]", value);
|
||||
// log.info(" + smsTxtTemp.contains(placeholder) [{}]", smsTxtTemp.contains(placeholder));
|
||||
if (smsTxt.contains(placeholder)) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
// statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "치환 문구중 " + placeholder + " 데이터가 없습니다.");
|
||||
StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "치환 문구중 " + placeholder + " 데이터가 없습니다.", "STAT_1040");
|
||||
statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "치환 문구중 " + placeholder + " 데이터가 없습니다.");
|
||||
return false;
|
||||
}
|
||||
smsTxt = smsTxt.replace(placeholder, value);
|
||||
@ -290,8 +293,7 @@ public final class MsgSendUtils {
|
||||
if (!hasPerformedMsgType) {
|
||||
msgTypeResult = getMsgTypeWithByteValidation(sendVO, smsTxt);
|
||||
if ("INVALID".equals(msgTypeResult)) {
|
||||
// statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다.");
|
||||
StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다.", "STAT_1050");
|
||||
statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다.");
|
||||
return false;
|
||||
}
|
||||
hasPerformedMsgType = true;
|
||||
@ -308,8 +310,7 @@ public final class MsgSendUtils {
|
||||
// 메시지 타입 체크는 매번 수행
|
||||
msgTypeResult = getMsgTypeWithByteValidation(sendVO, smsTxt);
|
||||
if ("INVALID".equals(msgTypeResult)) {
|
||||
// statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다.");
|
||||
StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다.", "STAT_1050");
|
||||
statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "문자 치환 후 전송 문자 길이를 초과하였습니다.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -462,7 +463,7 @@ public final class MsgSendUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static Boolean getReplaceYN(String smsTxtTemplate) {// 여러 치환 구문이 포함된 정규식 패턴
|
||||
private static Boolean getReplaceYN(String smsTxtTemplate) {// 여러 치환 구문이 포함된 정규식 패턴
|
||||
|
||||
if (smsTxtTemplate == null) {
|
||||
return false; // null일 경우 false 반환
|
||||
@ -543,7 +544,6 @@ public final class MsgSendUtils {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static StatusResponse validateFilesForMessageSending(int fileCount, MjonMsgVO mjonMsgVO) {
|
||||
if (fileCount > 0) {
|
||||
boolean allFilesAreNull = Stream
|
||||
|
||||
@ -2,10 +2,7 @@ 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 {
|
||||
@ -37,9 +34,9 @@ public interface CertPhoneService {
|
||||
|
||||
public StatusResponse selectSysMsgLogCheck(MberCertPhoneVO mberCertPhoneVO);
|
||||
|
||||
public MberCertPhoneVO selectCertUrlCode(MberCertPhoneVO mberCertPhoneVO) throws Exception;
|
||||
|
||||
public StatusResponse insertCertLog(HttpServletRequest request) throws Exception;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -34,17 +34,8 @@ public class MberCertPhoneVO extends UserDefaultVO{
|
||||
|
||||
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() {
|
||||
@ -83,76 +74,6 @@ public class MberCertPhoneVO extends UserDefaultVO{
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -6,7 +6,6 @@ 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 {
|
||||
@ -39,12 +38,4 @@ public class CertPhoneDAO extends EgovAbstractDAO {
|
||||
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,25 +1,17 @@
|
||||
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 {
|
||||
@ -107,35 +99,6 @@ public class CertPhoneServiceImpl extends EgovAbstractServiceImpl implements Cer
|
||||
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,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";
|
||||
}
|
||||
}
|
||||
@ -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;
|
||||
|
||||
|
||||
/**
|
||||
* 팩스 주소록 그룹 리스트
|
||||
@ -548,25 +544,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";
|
||||
// }
|
||||
KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
|
||||
// mberId null일경우 ""로
|
||||
mberManageVO.setMberId(EgovStringUtil.isNullToString(mberManageVO.getMberId()));
|
||||
|
||||
MberCertPhoneVO mberCertPhoneVO = new MberCertPhoneVO();
|
||||
mberCertPhoneVO.setTrUrl("/web/cop/kmc/authRequestAddrSubmitAjax.do");
|
||||
mberCertPhoneVO.setPlusInfo(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.authCertCheck(mberCertPhoneVO, request);
|
||||
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());
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -796,16 +796,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 생략
|
||||
}
|
||||
@ -45,37 +45,23 @@ public class KakaoSendAdvcVO implements Serializable {
|
||||
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 atDelayYn; // 카카오 알림톡 단가
|
||||
private String bizKakaoResendOrgnlTxt; // 카카오 알림톡 단가
|
||||
private String bizKakaoResendType; // 카카오 알림톡 단가
|
||||
private String filePath1; // 대체문자 이미지
|
||||
private String fileCnt; // 파일 카운트
|
||||
private String bizKakaoImageType; // 파일 카운트
|
||||
|
||||
private String spamStatus;
|
||||
|
||||
|
||||
|
||||
|
||||
@ -97,13 +83,12 @@ public class KakaoSendAdvcVO implements Serializable {
|
||||
"\n , msgType=[" + msgType + "]" +
|
||||
"\n , templateContent=[" + templateContent + "]" +
|
||||
"\n , templateTitle=[" + templateTitle + "]" +
|
||||
"\n , buttonList=[" + (buttonList != null ? buttonList.toString() : "") + "]" +
|
||||
"\n , buttonList=[" + 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 + "]" +
|
||||
@ -118,8 +103,6 @@ public class KakaoSendAdvcVO implements Serializable {
|
||||
"\n , atDelayYn=[" + atDelayYn + "]" +
|
||||
"\n , bizKakaoResendOrgnlTxt=[" + bizKakaoResendOrgnlTxt + "]" +
|
||||
"\n , bizKakaoResendType=[" + bizKakaoResendType + "]" +
|
||||
"\n , filePath1=[" + filePath1 + "]" +
|
||||
"\n , bizKakaoImageType=[" + bizKakaoImageType + "]" +
|
||||
"\n ]";
|
||||
}
|
||||
|
||||
|
||||
@ -1,17 +1,12 @@
|
||||
package itn.let.kakao.kakaoComm;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
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.function.Function;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@ -24,23 +19,17 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import itn.com.cmm.MjonFTSendVO;
|
||||
import itn.com.cmm.MjonMsgSendVO;
|
||||
import itn.com.cmm.util.MsgSendUtils;
|
||||
import itn.com.cmm.util.StringUtil;
|
||||
import itn.let.kakao.kakaoComm.kakaoApi.KakaoApiJsonSave;
|
||||
import itn.let.kakao.kakaoComm.kakaoApi.KakaoApiTemplate;
|
||||
import itn.let.kakao.user.kakaoAt.service.impl.KakaoAlimTalkDAO;
|
||||
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.mjo.spammsg.web.ComGetSpamStringParser;
|
||||
import itn.let.module.base.PriceAndPoint;
|
||||
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;
|
||||
|
||||
@Slf4j
|
||||
@ -50,15 +39,9 @@ public class KakaoSendUtil {
|
||||
@Autowired
|
||||
KakaoApiJsonSave kakaoApiJsonSave;
|
||||
|
||||
@Resource(name="kakaoAlimTalkDAO")
|
||||
private KakaoAlimTalkDAO kakaoAlimTalkDAO;
|
||||
|
||||
@Resource(name = "MjonMsgDataService")
|
||||
private MjonMsgDataService mjonMsgDataService;
|
||||
|
||||
@Resource(name = "mjonMsgDAO")
|
||||
private MjonMsgDAO mjonMsgDAO;
|
||||
|
||||
@Autowired
|
||||
KakaoApiTemplate kakaoApiTemplate;
|
||||
|
||||
@ -68,7 +51,6 @@ public class KakaoSendUtil {
|
||||
@Autowired
|
||||
private MjonCommon mjonCommon;
|
||||
|
||||
|
||||
// 클래스 수준에서 정적 Pattern 정의 (성능 최적화)
|
||||
private static final Pattern REPLACEMENT_PATTERN = Pattern.compile("#\\{[^}]+\\}");
|
||||
|
||||
@ -112,17 +94,13 @@ public class KakaoSendUtil {
|
||||
// log.info(" + templateDetail :: [{}]", templateDetail);
|
||||
// templateDetail.getButtonList().forEach(t->log.info(" + ButtonList :: [{}]", t.toString()));
|
||||
|
||||
// API인지 확인하는 Boolean
|
||||
Boolean isApiData = "A".equals(kakaoVO.getSendKind());
|
||||
|
||||
Boolean hasContentReplacement = this.replBooleanStrChecker(templateContent);
|
||||
Boolean hasTitleReplacement = this.replBooleanStrChecker(templateTitle);
|
||||
Boolean hasButtonReplacement = this.needsButtonReplacement(templateDetail.getButtonList());
|
||||
|
||||
/** @jsonStr 필요유무 */
|
||||
boolean hasTitleOrButtons = StringUtils.isNotEmpty(templateTitle)
|
||||
|| CollectionUtils.isNotEmpty(templateDetail.getButtonList())
|
||||
|| "IMAGE".equalsIgnoreCase(templateDetail.getTemplateEmphasizeType()); // 템플릿 강조 유형 이미지 유형을 알기 위해 추가
|
||||
|| CollectionUtils.isNotEmpty(templateDetail.getButtonList());
|
||||
|
||||
/** @jsonStr 반복유무 */
|
||||
boolean needsJsonReplacement = hasTitleReplacement || hasButtonReplacement;
|
||||
@ -135,16 +113,7 @@ public class KakaoSendUtil {
|
||||
// 사용자 개인 단가 정보 불러오기
|
||||
MberManageVO mberManageVO = mjonMsgDataService.selectMberManageInfo(kakaoVO.getUserId());
|
||||
|
||||
kakaoVO.setAtSmishingYn(mberManageVO.getAtSmishingYn());
|
||||
|
||||
float shortPrice = getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice());
|
||||
float longPrice = getValidPrice(mberManageVO.getLongPrice(), sysJoinSetVO.getLongPrice());
|
||||
float kakaoAtPrice = getValidPrice(mberManageVO.getKakaoAtPrice(), sysJoinSetVO.getKakaoAtPrice());
|
||||
|
||||
|
||||
String shortPStr = Float.toString(shortPrice);
|
||||
String mmsPStr = Float.toString(longPrice);
|
||||
String kakaoAtPStr = Float.toString(kakaoAtPrice);
|
||||
|
||||
|
||||
/** @MSGID KEY값 */
|
||||
@ -154,14 +123,12 @@ public class KakaoSendUtil {
|
||||
// kakaoSendAdvcListVO.get(i).setBizJsonName(idList.get(i));
|
||||
// }
|
||||
|
||||
String templateEmphasizeType = kakaoVO.getTemplateEmphasizeType();
|
||||
|
||||
|
||||
// 분할 건수 카운터
|
||||
int counter = 0;
|
||||
/** @Map에 총 갯수가 수신자 갯수와 동일함 */
|
||||
List<Map<String, String>> varList = kakaoVO.getVarListMap();
|
||||
|
||||
for (int i = 0; i < varList.size(); i++) {
|
||||
// for(Map<String, String> variables : kakaoVO.getVarListMap()) {
|
||||
// 치환 데이터
|
||||
@ -169,13 +136,7 @@ public class KakaoSendUtil {
|
||||
log.info("");
|
||||
|
||||
/** @공통 기본값 */
|
||||
KakaoSendAdvcVO sendVO = createATSendVO(kakaoVO);
|
||||
// 공통 가격 설정
|
||||
sendVO.setSmsPrice(shortPStr);
|
||||
sendVO.setMmsPrice(mmsPStr);
|
||||
sendVO.setKakaoAtPrice(kakaoAtPStr);
|
||||
|
||||
|
||||
KakaoSendAdvcVO sendVO = createSendVO(kakaoVO);
|
||||
String msgId = idList.get(i);
|
||||
sendVO.setMsgId(msgId);
|
||||
|
||||
@ -190,21 +151,12 @@ public class KakaoSendUtil {
|
||||
/** @Step1-3: 템플릿 치환데이터 설정 */
|
||||
String templateContentTemp = templateContent;
|
||||
String templateTitleTemp = templateTitle;
|
||||
|
||||
// api가 아니면
|
||||
if(!isApiData) {
|
||||
if (hasContentReplacement) {
|
||||
templateContentTemp = mjonCommon.ATReplaceTemplateVariables(templateContent, variables);
|
||||
if(hasTitleReplacement) {
|
||||
templateTitleTemp = mjonCommon.ATReplaceTemplateVariables(templateTitle, variables);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
templateContentTemp = variables.get("templateContent");
|
||||
templateTitleTemp = variables.get("templateTitle");
|
||||
}
|
||||
|
||||
|
||||
/** @버튼 치환 */ // 버튼 리스트가 있으면 치환 수행, 항상 sendVO에 설정
|
||||
List<KakaoButtonVO> buttonList = templateDetail.getButtonList();
|
||||
if(hasButtonReplacement) {
|
||||
@ -216,22 +168,44 @@ public class KakaoSendUtil {
|
||||
sendVO.setTemplateContent(templateContentTemp);
|
||||
|
||||
|
||||
String subMsgTxtTemp = subMsgTxt;
|
||||
// Step 1-4: 실패 대체 문자 치환데이터 설정
|
||||
if("Y".equals(kakaoVO.getSubMsgSendYn())) { // 대체문자가 있나?
|
||||
// api가 아니면
|
||||
if(!isApiData) {
|
||||
if ("Y".equals(kakaoVO.getSubMsgTxtReplYn())) { // 치환데이터가 있나?
|
||||
subMsgTxtTemp = mjonCommon.ATReplaceTemplateVariables(subMsgTxt, variables);
|
||||
subMsgTxt = mjonCommon.ATReplaceTemplateVariables(subMsgTxt, variables);
|
||||
}
|
||||
}else {
|
||||
subMsgTxtTemp = variables.get("subMsgTxt");
|
||||
}
|
||||
sendVO.setSubMsgTxt(subMsgTxtTemp);// 실패
|
||||
sendVO.setSubMsgTxt(subMsgTxt);// 실패
|
||||
}
|
||||
sendVO.setSubMsgSendYn(kakaoVO.getSubMsgSendYn());
|
||||
|
||||
|
||||
/*
|
||||
log.info("kakaoSendAdvcVO Details: [callTo={}\n, templateContent=\n{}\n, subMsgTxt=\n{}]\n\n\n\n",
|
||||
kakaoSendAdvcVO.getCallTo(),
|
||||
kakaoSendAdvcVO.getTemplateContent(),
|
||||
kakaoSendAdvcVO.getSubMsgTxt()
|
||||
);
|
||||
*/
|
||||
|
||||
// Step1 END
|
||||
|
||||
|
||||
// step3
|
||||
// 바이트 수 체크 및 금액설정
|
||||
|
||||
|
||||
Float kakaoAtPrice = mberManageVO.getKakaoAtPrice();
|
||||
// 유효한 단가 계산
|
||||
float shortPrice = getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice());
|
||||
float longPrice = getValidPrice(mberManageVO.getLongPrice(), sysJoinSetVO.getLongPrice());
|
||||
|
||||
|
||||
String shortPStr = Float.toString(shortPrice);
|
||||
String mmsPStr = Float.toString(longPrice);
|
||||
|
||||
// 공통 가격 설정
|
||||
sendVO.setSmsPrice(shortPStr);
|
||||
sendVO.setMmsPrice(mmsPStr);
|
||||
|
||||
|
||||
if("Y".equals(kakaoVO.getSubMsgSendYn())) {
|
||||
int smsTxtByte = mjonCommon.getSmsTxtBytes(sendVO.getSubMsgTxt());
|
||||
@ -239,8 +213,7 @@ public class KakaoSendUtil {
|
||||
sendVO.setSubMsgType(sendType);
|
||||
|
||||
if ("INVALID".equals(sendType)) {
|
||||
// statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "전송 문자 길이를 초과하였습니다.");return kakaoSendAdvcListVO;
|
||||
StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "전송 문자 길이를 초과하였습니다.", "STAT_1080");return kakaoSendAdvcListVO;
|
||||
statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "전송 문자 길이를 초과하였습니다.");return kakaoSendAdvcListVO;
|
||||
}
|
||||
|
||||
boolean isMms = "MMS".equals(sendType);
|
||||
@ -248,7 +221,8 @@ public class KakaoSendUtil {
|
||||
|
||||
|
||||
} else {
|
||||
sendVO.setEachPrice(kakaoAtPStr);
|
||||
kakaoAtPrice = getValidPrice(mberManageVO.getKakaoAtPrice(), sysJoinSetVO.getKakaoAtPrice());
|
||||
sendVO.setEachPrice( Float.toString(kakaoAtPrice) );
|
||||
}
|
||||
|
||||
|
||||
@ -295,465 +269,19 @@ public class KakaoSendUtil {
|
||||
return kakaoSendAdvcListVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : populateSendListsFT
|
||||
* @author : 이호영
|
||||
* @date : 2025. 4. 18.
|
||||
* @description :
|
||||
* @return : List<KakaoSendAdvcVO>
|
||||
* @param kakaoVO
|
||||
* @param isHolidayNotified
|
||||
* @param statusResponse
|
||||
* @return
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public List<KakaoSendAdvcVO> populateSendListsFT(KakaoVO kakaoVO
|
||||
, boolean isHolidayNotified
|
||||
, StatusResponse statusResponse
|
||||
, UserManageVO userManageVO
|
||||
, List<String> resultSpamTxt
|
||||
) throws Exception {
|
||||
|
||||
//사용자 현재 보유 금액 불러오기(문자 발송 금액 차감 이전 금액)
|
||||
// String befCash = kakaoVO.getBefCash();
|
||||
|
||||
log.info("kakaoVO.ftToString() :: [{}]", kakaoVO.ftToString());
|
||||
|
||||
|
||||
private Calendar setupBaseDate(KakaoVO kakaoVO, boolean isNotified) throws ParseException {
|
||||
// 예약 시간 기본값 설정
|
||||
Date now = new Date();
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||
|
||||
String atSmishingYn = userManageVO.getAtSmishingYn();
|
||||
String exceptSpamYn = userManageVO.getExceptSpamYn();
|
||||
|
||||
|
||||
List<KakaoSendAdvcVO> kakaoSendAdvcListVO = new ArrayList<>();
|
||||
Calendar calendar = setupBaseDateFT(kakaoVO);
|
||||
|
||||
|
||||
|
||||
// 친구톡 내용
|
||||
String templateContent = kakaoVO.getTemplateContent();
|
||||
// 실패 대체 문자
|
||||
String subMsgTxt = kakaoVO.getSubMsgTxt();
|
||||
log.info(" + StringUtils.isNotEmpty(subMsgTxt) :: [{}]", StringUtils.isNotEmpty(subMsgTxt));
|
||||
if(StringUtils.isNotEmpty(subMsgTxt)) {
|
||||
kakaoVO.setSubMsgSendYn("Y");
|
||||
|
||||
// 광고문자면 처리 - 광고 Y
|
||||
if ("Y".equals(kakaoVO.getAdFlag())) {
|
||||
subMsgTxt = "(광고)" + subMsgTxt + "\n" + "무료거부 0808800858";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 사용자 개인 단가 정보 불러오기
|
||||
MberManageVO mberManageVO = mjonMsgDataService.selectMberManageInfo(kakaoVO.getUserId());
|
||||
// 시스템 기본 단가 정보 불러오기
|
||||
JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo();
|
||||
|
||||
kakaoVO.setAtSmishingYn(mberManageVO.getAtSmishingYn());
|
||||
|
||||
// 치환 문구가 있는지 확인
|
||||
Boolean replaceYN = MsgSendUtils.getReplaceYN(templateContent);
|
||||
Boolean replaceSubYN = MsgSendUtils.getReplaceYN(subMsgTxt);
|
||||
|
||||
|
||||
/** @MSGID KEY값 */
|
||||
List<String> idList = mjonCommon.getNextCustomMsgCId(kakaoVO.getMjonFTSendVOList().size());
|
||||
|
||||
|
||||
Map<String, Function<MjonFTSendVO, String>> placeholders = new HashMap<>();
|
||||
placeholders.put("[*이름*]", MjonFTSendVO::getName);
|
||||
placeholders.put("[*1*]", MjonFTSendVO::getRep1);
|
||||
placeholders.put("[*2*]", MjonFTSendVO::getRep2);
|
||||
placeholders.put("[*3*]", MjonFTSendVO::getRep3);
|
||||
placeholders.put("[*4*]", MjonFTSendVO::getRep4);
|
||||
|
||||
String imageType = kakaoVO.getImageType();
|
||||
// 개인단가
|
||||
Float kakaoMemberFtPrice =
|
||||
imageType == null ? mberManageVO.getKakaoFtPrice() :
|
||||
"I".equals(imageType) ? mberManageVO.getKakaoFtImgPrice() :
|
||||
"W".equals(imageType) ? mberManageVO.getKakaoFtWideImgPrice() :
|
||||
mberManageVO.getKakaoFtPrice();
|
||||
|
||||
// 시스템단가
|
||||
Float kakaoSysJoinFtPrice =
|
||||
imageType == null ? sysJoinSetVO.getKakaoFtPrice() :
|
||||
"I".equals(imageType) ? sysJoinSetVO.getKakaoFtImgPrice() :
|
||||
"W".equals(imageType) ? sysJoinSetVO.getKakaoFtWideImgPrice() :
|
||||
sysJoinSetVO.getKakaoFtPrice();
|
||||
|
||||
Float kakaoFtPrice =
|
||||
getValidPrice(kakaoMemberFtPrice, kakaoSysJoinFtPrice);
|
||||
|
||||
// 대체문자가 있을경우 사용
|
||||
float shortPrice = getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice());
|
||||
float longPrice = getValidPrice(mberManageVO.getLongPrice(), sysJoinSetVO.getLongPrice());
|
||||
float picturePrice = getValidPrice(mberManageVO.getPicturePrice(), sysJoinSetVO.getPicturePrice());
|
||||
|
||||
boolean hasPerformedSpamCheck = false; // 치환 문자가 없는 경우, 스팸 체크가 한 번만 수행되도록 제어
|
||||
boolean hasPerformedSubSpamCheck = false; // 치환 문자가 없는 경우, 스팸 체크가 한 번만 수행되도록 제어
|
||||
boolean hasPerformedMsgType = false; // 치환 문자가 없는 경우, 메세지 타입 체크 한번
|
||||
boolean hasPerformedDelayYn = false; // 치환 문자가 없는 경우,
|
||||
|
||||
|
||||
|
||||
String imgFilePath = "";
|
||||
if(StringUtils.isNotEmpty(kakaoVO.getAtchFileId()) &&
|
||||
("I".equals(imageType) || "W".equals(imageType))) {
|
||||
imgFilePath = mjonMsgDAO.selectPhotoImgFileRealPath(kakaoVO.getAtchFileId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** @jsonStr 필요유무 */
|
||||
boolean hasButtons = CollectionUtils.isNotEmpty(kakaoVO.getButtonVOList());
|
||||
String sharedJsonStr = null;
|
||||
|
||||
|
||||
// 치환데이터가 없는 경우 한 번만 계산하기 위한 캐시 변수 추가
|
||||
Map<String, Object> sharedPricingResult = null;
|
||||
// 치환데이터가 없는 경우 for문 전에 한 번만 계산
|
||||
if (!replaceSubYN && StringUtils.isNotEmpty(subMsgTxt)) {
|
||||
sharedPricingResult = calculateSubMsgPricing(subMsgTxt, imgFilePath, shortPrice, longPrice, picturePrice, kakaoFtPrice);
|
||||
|
||||
// 사전계산에서 INVALID인 경우 즉시 리턴
|
||||
String preSendType = (String) sharedPricingResult.get("sendType");
|
||||
if ("INVALID".equals(preSendType)) {
|
||||
statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "전송 문자 길이를 초과하였습니다.");
|
||||
return kakaoSendAdvcListVO;
|
||||
}
|
||||
}
|
||||
|
||||
List<MjonFTSendVO> mjonFTSendVOList = kakaoVO.getMjonFTSendVOList();
|
||||
|
||||
for (int i = 0; i < mjonFTSendVOList.size(); i++) {
|
||||
MjonFTSendVO mjonFTSendVO = mjonFTSendVOList.get(i);
|
||||
|
||||
KakaoSendAdvcVO sendVO = createFTSendVO(kakaoVO, calendar);
|
||||
// 공통 가격 설정
|
||||
sendVO.setSmsPrice(Float.toString(shortPrice));
|
||||
sendVO.setMmsPrice(Float.toString(longPrice));
|
||||
sendVO.setPicturePrice(Float.toString(picturePrice));
|
||||
|
||||
sendVO.setCallTo(mjonFTSendVO.getPhone());
|
||||
sendVO.setMsgId(idList.get(i));
|
||||
|
||||
|
||||
// 친구톡 문자
|
||||
String templateContentTemp = templateContent;
|
||||
// 치환 문자면
|
||||
if(replaceYN) {
|
||||
|
||||
// 각 치환 구문을 확인하고 치환할 값이 없으면 오류 반환
|
||||
for (Map.Entry<String, Function<MjonFTSendVO, String>> entry : placeholders.entrySet()) {
|
||||
String placeholder = entry.getKey();
|
||||
String value = entry.getValue().apply(mjonFTSendVO);
|
||||
if (templateContentTemp.contains(placeholder)) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "치환 문구중 " + placeholder + " 데이터가 없습니다.");
|
||||
return null;
|
||||
}
|
||||
templateContentTemp = templateContentTemp.replace(placeholder, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
sendVO.setTemplateContent(templateContentTemp);
|
||||
|
||||
// 실패 대체 문자
|
||||
String subMsgTxtTemp = null;
|
||||
if(StringUtils.isNotEmpty(subMsgTxt)) {
|
||||
subMsgTxtTemp = subMsgTxt;
|
||||
|
||||
if(replaceSubYN) {
|
||||
// 각 치환 구문을 확인하고 치환할 값이 없으면 오류 반환
|
||||
for (Map.Entry<String, Function<MjonFTSendVO, String>> entry : placeholders.entrySet()) {
|
||||
String placeholder = entry.getKey();
|
||||
String value = entry.getValue().apply(mjonFTSendVO);
|
||||
if (subMsgTxtTemp.contains(placeholder)) {
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "치환 문구중 " + placeholder + " 데이터가 없습니다.");
|
||||
return null;
|
||||
}
|
||||
subMsgTxtTemp = subMsgTxtTemp.replace(placeholder, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sendVO.setSubMsgTxt(subMsgTxtTemp);
|
||||
|
||||
|
||||
//대체문자가 있으면
|
||||
// Step 1-4: 실패 대체 문자 치환데이터 설정
|
||||
if(StringUtils.isNotEmpty(subMsgTxtTemp)) { // 대체문자가 있나?
|
||||
|
||||
// 최적화된 계산 로직
|
||||
Map<String, Object> pricingResult;
|
||||
|
||||
if (replaceSubYN) {
|
||||
// 치환데이터 있음 → 매번 새로 계산
|
||||
pricingResult = calculateSubMsgPricing(subMsgTxtTemp, imgFilePath,
|
||||
shortPrice, longPrice, picturePrice, kakaoFtPrice);
|
||||
|
||||
// INVALID 체크
|
||||
String resultSendType = (String) pricingResult.get("sendType");
|
||||
if ("INVALID".equals(resultSendType)) {
|
||||
statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "전송 문자 길이를 초과하였습니다.");
|
||||
return kakaoSendAdvcListVO;
|
||||
}
|
||||
// ReqDate가 비어 있으면 현재 시간으로 설정, 그렇지 않으면 ReqDate로 설정
|
||||
// 화면에서 예약문자면 예약시간을 regDate로 설정한다.
|
||||
Date baseDate;
|
||||
if (StringUtils.isEmpty(kakaoVO.getReqDate())) {
|
||||
kakaoVO.setReqDate(DATE_FORMATTER.format(now)); // ReqDate에 현재 시간 설정
|
||||
baseDate = now;
|
||||
} else {
|
||||
// 치환데이터 없음 → 미리 계산된 결과 재사용
|
||||
pricingResult = sharedPricingResult;
|
||||
baseDate = DATE_FORMATTER.parse(kakaoVO.getReqDate()); // ReqDate를 baseDate로 설정
|
||||
}
|
||||
|
||||
|
||||
// 결과 적용
|
||||
applyPricingResult(sendVO, pricingResult);
|
||||
|
||||
|
||||
}else {
|
||||
// 대체문자가 없으면 카카오톡 단가 그대로 사용
|
||||
sendVO.setEachPrice( Float.toString(kakaoFtPrice) );
|
||||
}
|
||||
|
||||
|
||||
// 스팸 단어 체크
|
||||
// exceptSpam는 사용자 스팸 단어 체크할건지에 대한 여부 N : 체크
|
||||
if("N".equals(exceptSpamYn)) {
|
||||
// 친구톡 내용
|
||||
if(replaceYN) {
|
||||
checkSpamAndSetStatus(kakaoVO
|
||||
, templateContentTemp
|
||||
, resultSpamTxt, isHolidayNotified);
|
||||
}else if(!hasPerformedSpamCheck) {
|
||||
checkSpamAndSetStatus(kakaoVO
|
||||
, templateContentTemp
|
||||
, resultSpamTxt, isHolidayNotified);
|
||||
hasPerformedSpamCheck = true;
|
||||
}
|
||||
// 대체문자 내용
|
||||
if(StringUtils.isNotEmpty(subMsgTxtTemp)) {
|
||||
if(replaceSubYN) {
|
||||
checkSpamAndSetStatus(kakaoVO
|
||||
, subMsgTxtTemp
|
||||
, resultSpamTxt, isHolidayNotified);
|
||||
}else if(!hasPerformedSubSpamCheck) {
|
||||
checkSpamAndSetStatus(kakaoVO
|
||||
, subMsgTxtTemp
|
||||
, resultSpamTxt, isHolidayNotified);
|
||||
hasPerformedSubSpamCheck = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
log.info(" kakaoVO.toString() :: [{}]",kakaoVO.ftToString());
|
||||
|
||||
|
||||
/* @isHolidayNotified
|
||||
* - 관리자 알림 설정으로 인해
|
||||
* - 해당 시간이면 지연 미처리
|
||||
* @smishingYn
|
||||
* - 회원 별 '스미싱 온' 상태값
|
||||
* - Y면 알림, 지연 처리해야 함
|
||||
* */
|
||||
if("Y".equalsIgnoreCase(atSmishingYn) && isHolidayNotified) {
|
||||
kakaoVO.setSpamStatus("Y");
|
||||
kakaoVO.setSmishingYn("Y");
|
||||
kakaoVO.setAtDelayYn("Y");
|
||||
}
|
||||
|
||||
// 지연 여부 처리
|
||||
if (( "Y".equalsIgnoreCase(atSmishingYn) || "Y".equalsIgnoreCase(kakaoVO.getAtDelayYn()))
|
||||
&& !hasPerformedDelayYn && isHolidayNotified) {
|
||||
calendar.add(Calendar.MINUTE, 30); // 모든 시간을 30분 뒤로 미룸
|
||||
// TEST
|
||||
// calendar.add(Calendar.MINUTE, 5); // 모든 시간을 30분 뒤로 미룸
|
||||
hasPerformedDelayYn = true;
|
||||
}
|
||||
|
||||
sendVO.setReqDate(sdf.format(calendar.getTime())); // 분할된 시간 설정 또는 기본 예약 시간 사용
|
||||
|
||||
|
||||
|
||||
|
||||
// 타이틀이나 버튼이 있고
|
||||
if(hasButtons || StringUtils.isNotEmpty(kakaoVO.getTemplateImageUrl())) {
|
||||
//
|
||||
if (StringUtils.isEmpty(sharedJsonStr)) {
|
||||
// 치환 데이터가 없고 아직 생성되지 않았으면 한 번만 생성
|
||||
sharedJsonStr = kakaoApiJsonSave.kakaoApiFTJsonSave_advc(kakaoVO);
|
||||
sendVO.setJsonStr(sharedJsonStr);
|
||||
}
|
||||
sendVO.setBizJsonName(idList.get(0));
|
||||
|
||||
}
|
||||
|
||||
kakaoSendAdvcListVO.add(sendVO);
|
||||
log.info(" sendVO.toString() :: [{}]",sendVO.toString());
|
||||
}
|
||||
|
||||
|
||||
return kakaoSendAdvcListVO;
|
||||
}
|
||||
|
||||
private void checkSpamAndSetStatus(KakaoVO kakaoVO
|
||||
, String chkText
|
||||
, List<String> resultSpamTxt, boolean isHolidayNotified) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
kakaoVO.setSpamStatus("N");
|
||||
kakaoVO.setAtDelayYn("N");
|
||||
|
||||
if(StringUtils.isNotEmpty(chkText)) {
|
||||
|
||||
String resultParser = ComGetSpamStringParser.getSpamTextParse(chkText).trim();
|
||||
int spmCnt = 0;
|
||||
String spmFilterTxt = "";
|
||||
|
||||
for (String spmTxt : resultSpamTxt) {
|
||||
String parserStr = ComGetSpamStringParser.getSpamTextParse(spmTxt).trim();
|
||||
if (resultParser.contains(parserStr) || chkText.contains(parserStr)) {
|
||||
spmCnt++;
|
||||
spmFilterTxt += spmTxt + ",";
|
||||
}
|
||||
}
|
||||
|
||||
if (spmCnt > 0) { // 스팸 문자가 포함된 경우
|
||||
|
||||
if (StringUtil.getWordRight(spmFilterTxt.trim(), 1).equals(",")) {
|
||||
// 처음부터 idx 만큼 잘라낸 나머지 글자
|
||||
spmFilterTxt = StringUtil.getWordLeft(spmFilterTxt.trim(), 1);
|
||||
|
||||
}
|
||||
|
||||
/* @isHolidayNotified
|
||||
* - 관리자 알림 설정으로 인해
|
||||
* - 해당 시간이면 지연 미처리
|
||||
* */
|
||||
kakaoVO.setSpamStatus("Y");
|
||||
if(isHolidayNotified) {
|
||||
kakaoVO.setAtDelayYn("Y");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// TODO(human): 아래에 새로운 메소드 구현
|
||||
/**
|
||||
* 대체문자 가격 계산 최적화 메소드
|
||||
* @param subMsgTxt 대체문자 내용
|
||||
* @param imgFilePath 이미지 파일 경로
|
||||
* @param shortPrice 단문 가격
|
||||
* @param longPrice 장문 가격
|
||||
* @param picturePrice 사진 가격
|
||||
* @param kakaoFtPrice 카카오 친구톡 가격
|
||||
* @return 계산 결과 Map (sendType, chosenPrice, filePath 포함)
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
private Map<String, Object> calculateSubMsgPricing(String subMsgTxt, String imgFilePath,
|
||||
float shortPrice, float longPrice,
|
||||
float picturePrice, float kakaoFtPrice) throws UnsupportedEncodingException {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
|
||||
String sendType = "MMS";
|
||||
if(StringUtils.isEmpty(imgFilePath)) {
|
||||
int smsTxtByte = mjonCommon.getSmsTxtBytes(subMsgTxt);
|
||||
sendType = getMsgType(smsTxtByte);
|
||||
}
|
||||
|
||||
result.put("sendType", sendType);
|
||||
|
||||
// INVALID인 경우 추가 처리 없이 반환
|
||||
if ("INVALID".equals(sendType)) {
|
||||
return result;
|
||||
}
|
||||
|
||||
float chosenPrice = 0f;
|
||||
if(StringUtils.isNotEmpty(imgFilePath)) {
|
||||
chosenPrice = Math.max(picturePrice, kakaoFtPrice);
|
||||
result.put("filePath", imgFilePath);
|
||||
} else if ("MMS".equals(sendType)) {
|
||||
chosenPrice = Math.max(longPrice, kakaoFtPrice);
|
||||
} else {
|
||||
chosenPrice = Math.max(shortPrice, kakaoFtPrice);
|
||||
}
|
||||
|
||||
result.put("sendType", sendType);
|
||||
result.put("chosenPrice", Float.toString(chosenPrice));
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 가격 계산 결과를 sendVO에 적용하는 헬퍼 메소드
|
||||
* @param sendVO 적용할 KakaoSendAdvcVO 객체
|
||||
* @param pricingResult 가격 계산 결과 Map
|
||||
*/
|
||||
private void applyPricingResult(KakaoSendAdvcVO sendVO, Map<String, Object> pricingResult) {
|
||||
sendVO.setSubMsgType((String) pricingResult.get("sendType"));
|
||||
sendVO.setEachPrice((String) pricingResult.get("chosenPrice"));
|
||||
if (pricingResult.get("filePath") != null) {
|
||||
sendVO.setFilePath1((String) pricingResult.get("filePath"));
|
||||
sendVO.setFileCnt("1");
|
||||
}
|
||||
}
|
||||
|
||||
public static String getMsgTypeWithByteValidation(MjonFTSendVO 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;
|
||||
}
|
||||
|
||||
|
||||
private Calendar setupBaseDateFT(KakaoVO kakaoVO) throws ParseException {
|
||||
|
||||
// baseDate 추출
|
||||
Date baseDate = resolveBaseDate(kakaoVO);
|
||||
|
||||
// 시간 성정
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(baseDate); // calendar에 baseDate 설정
|
||||
|
||||
return calendar;
|
||||
}
|
||||
|
||||
private Calendar setupBaseDate(KakaoVO kakaoVO, boolean isHolidayNotified) throws ParseException {
|
||||
|
||||
// baseDate 추출
|
||||
Date baseDate = resolveBaseDate(kakaoVO);
|
||||
|
||||
// 시간 성정
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(baseDate); // calendar에 baseDate 설정
|
||||
@ -761,37 +289,12 @@ public class KakaoSendUtil {
|
||||
// 지연 여부 처리
|
||||
// 알림톡 스미싱의심 + 공휴일알림 조건이 맞으면 30분 delay
|
||||
if ( "Y".equalsIgnoreCase(kakaoVO.getAtSmishingYn())
|
||||
&& isHolidayNotified) {
|
||||
&& isNotified) {
|
||||
calendar.add(Calendar.MINUTE, 30); // 모든 시간을 30분 뒤로 미룸
|
||||
}
|
||||
return calendar;
|
||||
}
|
||||
|
||||
public Date resolveBaseDate(KakaoVO kakaoVO) throws ParseException {
|
||||
Date now = new Date();
|
||||
|
||||
if (StringUtils.isEmpty(kakaoVO.getReqDate())) {
|
||||
kakaoVO.setReqDate(DATE_FORMATTER.format(now));
|
||||
return now;
|
||||
}
|
||||
return DATE_FORMATTER.parse(kakaoVO.getReqDate());
|
||||
}
|
||||
|
||||
// 2. 친구톡 발송 제한 시간인지 확인
|
||||
public boolean isRestrictedFriendTalkTime(Date baseDate) {
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(baseDate);
|
||||
|
||||
int hour = cal.get(Calendar.HOUR_OF_DAY);
|
||||
int minute = cal.get(Calendar.MINUTE);
|
||||
|
||||
// 20:50 이후 ~ 익일 08:00 이전은 제한
|
||||
if ((hour == 20 && minute >= 50) || hour > 20 || hour < 8) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : createSendVO
|
||||
* @author : 이호영
|
||||
@ -802,45 +305,14 @@ public class KakaoSendUtil {
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
private KakaoSendAdvcVO createATSendVO(KakaoVO kakaoVO) {
|
||||
private KakaoSendAdvcVO createSendVO(KakaoVO kakaoVO) {
|
||||
KakaoSendAdvcVO sendVO = new KakaoSendAdvcVO();
|
||||
sendVO.setMsgType("8");
|
||||
sendVO.setAgentCode("04");
|
||||
sendVO.setSenderKey(kakaoVO.getSenderKey());
|
||||
sendVO.setTemplateCode(kakaoVO.getTemplateCode());
|
||||
sendVO.setUserId(kakaoVO.getUserId());
|
||||
sendVO.setCallFrom(kakaoVO.getCallFrom());
|
||||
return sendVO;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : createFTSendVO
|
||||
* @author : 이호영
|
||||
* @date : 2025. 4. 23.
|
||||
* @description :
|
||||
* @return : KakaoSendAdvcVO
|
||||
* @param kakaoVO
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
private KakaoSendAdvcVO createFTSendVO(KakaoVO kakaoVO, Calendar calendar) {
|
||||
KakaoSendAdvcVO sendVO = new KakaoSendAdvcVO();
|
||||
|
||||
sendVO.setMsgType("9"); // 알림톡 8 친구톡 9
|
||||
sendVO.setAgentCode("04");
|
||||
// 발송시간 : 친구톡은 분할 발송이 없어 처음 vo 생성 시 입력
|
||||
sendVO.setReqDate(DATE_FORMATTER.format(calendar.getTime()));
|
||||
|
||||
sendVO.setSenderKey(kakaoVO.getSenderKey());
|
||||
// sendVO.setTemplateCode(kakaoVO.getTemplateCode());
|
||||
sendVO.setUserId(kakaoVO.getUserId());
|
||||
sendVO.setCallFrom(kakaoVO.getCallFrom());
|
||||
sendVO.setSubMsgSendYn(kakaoVO.getSubMsgSendYn());
|
||||
|
||||
sendVO.setAdFlag(kakaoVO.getAdFlag());
|
||||
|
||||
|
||||
return sendVO;
|
||||
}
|
||||
|
||||
@ -902,7 +374,7 @@ public class KakaoSendUtil {
|
||||
}
|
||||
|
||||
|
||||
public static Float getValidPrice(Float personalPrice, Float defaultPrice) {
|
||||
public Float getValidPrice(Float personalPrice, Float defaultPrice) {
|
||||
return (personalPrice != null && personalPrice > 0) ? personalPrice : defaultPrice;
|
||||
}
|
||||
|
||||
@ -1216,10 +688,6 @@ public class KakaoSendUtil {
|
||||
//카카오 친구톡 개인 단가가 없는 경우 시스템 단가로
|
||||
if(mberManageVO.getKakaoFtPrice() == 0.0f)
|
||||
mberManageVO.setKakaoFtPrice(sysJoinSetVO.getKakaoFtPrice());
|
||||
if(mberManageVO.getKakaoFtImgPrice() == 0.0f)
|
||||
mberManageVO.setKakaoFtImgPrice(sysJoinSetVO.getKakaoFtImgPrice());
|
||||
if(mberManageVO.getKakaoFtWideImgPrice() == 0.0f)
|
||||
mberManageVO.setKakaoFtWideImgPrice(sysJoinSetVO.getKakaoFtWideImgPrice());
|
||||
|
||||
|
||||
// SMS 인경우
|
||||
@ -1232,8 +700,6 @@ public class KakaoSendUtil {
|
||||
if(mberManageVO.getLongPrice() == 0.0f)
|
||||
mberManageVO.setLongPrice(sysJoinSetVO.getLongPrice());
|
||||
|
||||
if(mberManageVO.getPicturePrice() == 0.0f)
|
||||
mberManageVO.setPicturePrice(sysJoinSetVO.getPicturePrice());
|
||||
|
||||
return mberManageVO;
|
||||
}
|
||||
@ -1732,178 +1198,4 @@ public class KakaoSendUtil {
|
||||
statusResponse.setMessage(msg);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 보유 금액이 충분한지 확인하는 메서드
|
||||
public 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);
|
||||
log.info(" + userMoney :: [{}]", userMoney);
|
||||
log.info(" + befCash :: [{}]", befCash);
|
||||
|
||||
|
||||
// 총 메시지 금액 계산 (HALF_EVEN 적용)
|
||||
BigDecimal totalEachPrice = kakaoSendAdvcListVO.stream()
|
||||
.map(msg -> new BigDecimal(String.valueOf(msg.getEachPrice()))) // 변환 오류 방지
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add)
|
||||
.setScale(2, RoundingMode.HALF_EVEN); // 일관성 유지
|
||||
|
||||
log.info(" + totalEachPrice :: [{}]", totalEachPrice);
|
||||
// 비교 수행
|
||||
return befCash.compareTo(totalEachPrice) >= 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : insertKakaoAtDataJsonInfo_advc
|
||||
* @author : 이호영
|
||||
* @date : 2025. 4. 24.
|
||||
* @description : INSERT INTO BIZ_ATTACHMENTS
|
||||
* @return : void
|
||||
* @param kakaoSendAdvcListVO
|
||||
*
|
||||
*/
|
||||
public void insertKakaoAtDataJsonInfo_advc(List<KakaoSendAdvcVO> kakaoSendAdvcListVO) {
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : insertKakaoData_advc
|
||||
* @author : 이호영
|
||||
* @date : 2025. 3. 20.
|
||||
* @description : 카카오 batch 발송 => mj_msg_data
|
||||
* @return : int
|
||||
* @param kakaoSendAdvcVOList
|
||||
* @param parentLoopCount
|
||||
* @param isJsonNotEmpty
|
||||
* @param isJsonNameAllSame
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
public 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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public 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.setTemplateContent(kakaoVO.getTemplateContent());
|
||||
sendVO.setMsgGroupCnt(Integer.toString(instCnt));
|
||||
sendVO.setReserveYn(kakaoVO.getReserveYn());
|
||||
sendVO.setBefCash(priceAndPoint.getBefCash(sendVO.getUserId()));
|
||||
sendVO.setBefPoint(priceAndPoint.getBefPoint(sendVO.getUserId()));
|
||||
sendVO.setAdFlag(kakaoVO.getAdFlag());
|
||||
|
||||
sendVO.setSendKind(kakaoVO.getSendKind());
|
||||
|
||||
Float eachPrice = Float.parseFloat(sendVO.getEachPrice());
|
||||
|
||||
Float totPrice = eachPrice * instCnt;
|
||||
sendVO.setTotPrice(String.format("%.1f", totPrice));
|
||||
|
||||
// sendVO.setAtDelayYn(kakaoVO.getAtDelayYn());
|
||||
sendVO.setAtDelayYn(kakaoVO.getAtSmishingYn());
|
||||
sendVO.setBizKakaoResendOrgnlTxt(kakaoVO.getSubMsgTxt());
|
||||
sendVO.setBizKakaoResendType(sendVO.getSubMsgType());
|
||||
sendVO.setBizKakaoImageType(kakaoVO.getImageType());
|
||||
|
||||
kakaoAlimTalkDAO.insertKakaoGroupDataTb_advc(sendVO);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import itn.com.cmm.MjonFTSendVO;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@ -261,13 +260,8 @@ public class KakaoVO extends MjonMsgVO{
|
||||
private String msgResendAllTmpKey;
|
||||
private String msgResendAllYellowId;
|
||||
|
||||
private String bizKakaoResendType;
|
||||
private String fileCnt;
|
||||
|
||||
private List<Map<String, String>> varListMap;
|
||||
|
||||
private List<MjonFTSendVO> mjonFTSendVOList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String varListMapString = "[";
|
||||
@ -292,18 +286,6 @@ public class KakaoVO extends MjonMsgVO{
|
||||
}
|
||||
varListMapString += "]";
|
||||
|
||||
|
||||
StringBuilder mjonFTListSb = new StringBuilder("[");
|
||||
if (mjonFTSendVOList != null && !mjonFTSendVOList.isEmpty()) {
|
||||
String prefix = "";
|
||||
for (MjonFTSendVO vo : mjonFTSendVOList) {
|
||||
mjonFTListSb.append(prefix).append(vo == null ? "null" : vo.toString());
|
||||
prefix = ", ";
|
||||
}
|
||||
}
|
||||
mjonFTListSb.append("]");
|
||||
|
||||
|
||||
return "KakaoSendAdvcVO[" +
|
||||
"\n senderKey=[" + senderKey + "]" +
|
||||
"\n , subMsgTxtReplYn=[" + subMsgTxtReplYn + "]" +
|
||||
@ -330,69 +312,8 @@ public class KakaoVO extends MjonMsgVO{
|
||||
"\n , varListMap=[" + varListMapString + "]" +
|
||||
"\n , befCash=[" + getBefCash() + "]" +
|
||||
"\n , befPoint=[" + getBefPoint() + "]" +
|
||||
"\n , mjonFTSendVOList=" + mjonFTListSb.toString() +
|
||||
"\n ]";
|
||||
}
|
||||
|
||||
public String ftToString() {
|
||||
StringBuilder sb = new StringBuilder("KakaoFTSendVO[");
|
||||
sb.append("\n sendKind=[").append(getSendKind()).append("]");
|
||||
sb.append("\n , senderKey=[").append(senderKey).append("]");
|
||||
sb.append("\n , imageFileName=[").append(imageFileName).append("]");
|
||||
sb.append("\n , imageType=[").append(imageType).append("]");
|
||||
sb.append("\n , atchFileId=[").append(atchFileId).append("]");
|
||||
// sb.append("\n , imgTitle=[").append(imgTitle).append("]");
|
||||
// sb.append("\n , imgLink=[").append(imgLink).append("]");
|
||||
sb.append("\n , templateContent=[").append(templateContent).append("]");
|
||||
sb.append("\n , templateImageUrl=[").append(templateImageUrl).append("]");
|
||||
// sb.append("\n , imgLink=[").append(imgLink).append("]");
|
||||
// sb.append("\n , smsTxtArea=[").append(getSubMsgTxt()).append("]");
|
||||
// sb.append("\n , subMsgSendYn=[").append(subMsgSendYn).append("]");
|
||||
// sb.append("\n , subMsgTxtReplYn=[").append(subMsgTxtReplYn).append("]");
|
||||
// sb.append("\n , subMsgType=[").append(subMsgType).append("]");
|
||||
sb.append("\n , subMsgTxt=[").append(subMsgTxt).append("]");
|
||||
sb.append("\n , subMsgSendYn=[").append(subMsgSendYn).append("]");
|
||||
sb.append("\n , reserveYn=[").append(getReserveYn()).append("]");
|
||||
// sb.append("\n , menuTopTab=[").append(menuTopTab).append("]");
|
||||
// sb.append("\n , bizJsonYn=[").append(bizJsonYn).append("]");
|
||||
sb.append("\n , callFrom=[").append(getCallFrom()).append("]");
|
||||
// sb.append("\n , kakaoFtPrice=[").append(getEachPrice()).append("]");
|
||||
sb.append("\n , reqDate=[").append(getReqDate()).append("]");
|
||||
// sb.append("\n , spamStatus=[").append(getSpamStatus()).append("]");
|
||||
// sb.append("\n , txtReplYn=[").append(getTxtReplYn()).append("]");
|
||||
// sb.append("\n , atSmishingYn=[").append(getAtSmishingYn()).append("]");
|
||||
// sb.append("\n , atDelayYn=[").append(getAtDelayYn()).append("]");
|
||||
// sb.append("\n , filePath1=[").append(getFilePath1()).append("]");
|
||||
// sb.append("\n , tmpBtnSelect=[").append(getTmpBtnSelect()).append("]");
|
||||
StringBuilder btnListSb = new StringBuilder("[");
|
||||
if (buttonVOList != null && !buttonVOList.isEmpty()) {
|
||||
String prefix = "";
|
||||
for (KakaoButtonVO btn : buttonVOList) {
|
||||
btnListSb.append(prefix).append(btn == null ? "null" : btn.toString());
|
||||
prefix = ", ";
|
||||
}
|
||||
}
|
||||
btnListSb.append("]");
|
||||
sb.append("\n , buttonVOList=").append(btnListSb);
|
||||
|
||||
|
||||
// mjonFTSendVOList 내용
|
||||
StringBuilder ftList = new StringBuilder("[");
|
||||
if (mjonFTSendVOList != null && !mjonFTSendVOList.isEmpty()) {
|
||||
String prefix = "";
|
||||
for (MjonFTSendVO vo : mjonFTSendVOList) {
|
||||
ftList.append(prefix).append(vo == null ? "null" : vo.toString());
|
||||
prefix = ", ";
|
||||
}
|
||||
}
|
||||
ftList.append("]");
|
||||
sb.append("\n , mjonFTSendVOList=").append(ftList);
|
||||
|
||||
sb.append("\n]");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -69,16 +58,6 @@ 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,8 +219,8 @@ 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();
|
||||
@ -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,8 +488,6 @@ 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"));
|
||||
@ -693,7 +499,6 @@ public class KakaoApiImageUpload {
|
||||
String result = "";
|
||||
String statusCode = Integer.toString(response.getStatusLine().getStatusCode());
|
||||
|
||||
log.info(" + statusCode :: [{}]", statusCode);
|
||||
if(statusCode.equals("200")) {
|
||||
|
||||
result = EntityUtils.toString(response.getEntity());
|
||||
@ -724,6 +529,4 @@ public class KakaoApiImageUpload {
|
||||
return kakaoReturnVO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -10,18 +10,12 @@ 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;
|
||||
@ -214,139 +208,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
|
||||
|
||||
@ -148,8 +148,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,7 +230,6 @@ 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"); //카카오톡 채널
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -4,7 +4,7 @@ import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import itn.let.kakao.kakaoComm.KakaoReturnVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoSendAdvcVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgReturnVO;
|
||||
@ -23,13 +23,12 @@ public interface KakaoAlimTalkService {
|
||||
//카카오 친구톡 발신
|
||||
public MjonMsgReturnVO insertKakaoFtSendAjax(KakaoVO kakaoVO) throws Exception;
|
||||
|
||||
//카카오 알림톡 전송 실패 환불리스트 조회
|
||||
public void selectKakaoAtSentRefundList() throws Exception;
|
||||
|
||||
//카카오 친구톡 전송 실패 환불리스트 조회
|
||||
public void selectKakaoFtSentRefundList() throws Exception;
|
||||
|
||||
StatusResponse insertKakaoAtSandAjax_advc(KakaoVO kakaoVO, HttpServletRequest request) throws Exception;
|
||||
|
||||
//카카오(알림톡, 친구톡 통합) 전송 실패 환불리스트 조회
|
||||
public List<KakaoVO> selectKakaoSentRefundListForSingle() throws Exception;
|
||||
|
||||
public void kakaoSingleRefund(KakaoVO kakaoVO) throws Exception;
|
||||
|
||||
//발신 프로필 등록 처리
|
||||
public KakaoReturnVO createKaKaoProfile(KakaoVO kakaoVO) throws Exception;
|
||||
}
|
||||
|
||||
@ -49,8 +49,13 @@ public class KakaoAlimTalkDAO extends EgovAbstractDAO {
|
||||
}
|
||||
|
||||
@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{
|
||||
@ -103,9 +108,4 @@ public class KakaoAlimTalkDAO extends EgovAbstractDAO {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,6 +11,8 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -25,13 +27,11 @@ 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.cmm.MjonMsgSendVO;
|
||||
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;
|
||||
@ -45,11 +45,11 @@ 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 itn.let.uss.umt.service.UserManageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@ -87,12 +87,6 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
@Resource(name = "userManageService")
|
||||
private EgovUserManageService userManageService;
|
||||
|
||||
@Resource(name = "kakaoApiService")
|
||||
private KakaoApiService kakaoApiService;
|
||||
|
||||
@Autowired
|
||||
private MjonPayDAO mjonPayDAO;
|
||||
|
||||
@Autowired
|
||||
KakaoSendUtil kakaoSendUtil;
|
||||
|
||||
@ -102,13 +96,6 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
@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
|
||||
public int updateKakaoProfileStatus(KakaoVO kakaoVO) throws Exception{
|
||||
@ -796,82 +783,86 @@ 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())) {
|
||||
/*
|
||||
* 카카오 알림톡 발송 실패에 따른 금액 환불 처리
|
||||
*
|
||||
* */
|
||||
@Override
|
||||
public void selectKakaoAtSentRefundList() throws Exception {
|
||||
|
||||
BizKakaoPriceVO bizKakaoPriceVO = mjonPayDAO.selectBizKakaoPrice(kakaoVO.getMsgGroupId());
|
||||
/**
|
||||
* 1. 카카오 AT 전송성공 확인
|
||||
* 2. 카카오 AT 전송실패, 대채문자 전송확인
|
||||
* 3. 카카오 AT 전송 실패 확인
|
||||
*/
|
||||
List<KakaoVO> kakaoAtSentRefundList = kakaoAlimTalkDAO.selectKakaoAtSentRefundList();
|
||||
|
||||
BigDecimal sendPrice = null;
|
||||
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);
|
||||
|
||||
if(AT_MSG_TYPE.equals(kakaoVO.getMsgType())){
|
||||
sendPrice = new BigDecimal(bizKakaoPriceVO.getBizKakaoAtPrice());
|
||||
System.out.println("대체문자 전송 : " + info.getBizUmid());
|
||||
if (info.getBizUmid() != null) {
|
||||
kakaoAlimTalkDAO.updateKakaoAtSubMsgSend(vo);
|
||||
}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() + " 발송 성공 후 대체문자 금액 환불");
|
||||
kakaoAlimTalkDAO.updateKakaoAtNotSend(vo);
|
||||
}
|
||||
|
||||
}else {
|
||||
kakaoAlimTalkDAO.updateKakaoAtNotSend(vo);
|
||||
}
|
||||
|
||||
//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() + " 전송 실패로 인한 결제 금액 환불");
|
||||
}
|
||||
/*
|
||||
* 카카오 친구톡 발송 실패에 따른 금액 환불 처리
|
||||
* 카카오 친구톡 대체문자 선택에 대해 성공시 친구톡과 문자 간 금액 차액의 환불도 처리 됨.
|
||||
* */
|
||||
@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);
|
||||
}
|
||||
|
||||
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()
|
||||
);
|
||||
}else {
|
||||
kakaoAlimTalkDAO.updateKakaoFtNotSend(vo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StatusResponse insertKakaoAtSandAjax_advc(KakaoVO kakaoVO, HttpServletRequest request) throws Exception {
|
||||
|
||||
log.info(" :: [{}]", kakaoVO.toString());
|
||||
// log.info(" :: [{}]", kakaoVO.toString());
|
||||
|
||||
|
||||
// 측정할 메소드 호출 전 시간 기록
|
||||
@ -879,24 +870,16 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
// 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());
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if (userId.equals("")) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용이 가능합니다.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
kakaoVO.setUserId(userId);
|
||||
|
||||
/**
|
||||
@ -907,7 +890,7 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
request.getSession().invalidate();
|
||||
// UNAUTHORIZED : 인증되지 않은 사용자가 접근하려고 할 때
|
||||
return new StatusResponse(HttpStatus.UNAUTHORIZED,
|
||||
"현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 알림톡을 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.", "STAT_1070");
|
||||
"현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 알림톡을 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.");
|
||||
}
|
||||
|
||||
|
||||
@ -930,16 +913,15 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
|
||||
/** @전송금액 확인 --------------------------------------------------*/
|
||||
if (!kakaoSendUtil.isCashSufficient(userId, kakaoSendAdvcListVO)) {
|
||||
if (!isCashSufficient(userId, kakaoSendAdvcListVO)) {
|
||||
log.error("Insufficient balance for message sending.");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다.", "STAT_1060");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** @json파일이 있을 떄 biz_attachments insert */
|
||||
kakaoSendUtil.insertKakaoAtDataJsonInfo_advc(kakaoSendAdvcListVO);
|
||||
// this.insertKakaoAtDataJsonInfo_advc(kakaoSendAdvcListVO);
|
||||
this.insertKakaoAtDataJsonInfo_advc(kakaoSendAdvcListVO);
|
||||
|
||||
|
||||
Map<String, List<KakaoSendAdvcVO>> priceGroupedMessages = kakaoSendAdvcListVO.stream()
|
||||
@ -949,8 +931,6 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
// 임시
|
||||
List<String> nextMsgGroupIdA = new ArrayList<>();
|
||||
// 대안: entrySet() 직접 사용
|
||||
String apiMsgGroupId = "";
|
||||
String apiMsgType = "";
|
||||
for (Map.Entry<String, List<KakaoSendAdvcVO>> entry : priceGroupedMessages.entrySet()) {
|
||||
// entry 사용
|
||||
|
||||
@ -960,31 +940,8 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
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 = this.insertKakaoData_advc(groupedMsgList);
|
||||
// int instCnt = 6;
|
||||
|
||||
if(instCnt > 0) {
|
||||
@ -993,15 +950,13 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
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);
|
||||
this.insertKakaoGroupDataTb_advc(instCnt, kakaoVO, sendVO);
|
||||
|
||||
|
||||
/** @biz_kakao_price에 insert (대체문자 환불관련 테이블)*/
|
||||
kakaoVO.setMsgGroupId(sendVO.getMsgGroupId());
|
||||
kakaoVO.setKakaoAtPrice(Float.parseFloat(sendVO.getKakaoAtPrice()));
|
||||
kakaoVO.setKakaoAtPrice(Float.parseFloat(sendVO.getEachPrice()));
|
||||
kakaoVO.setSmsPrice(Float.parseFloat(sendVO.getSmsPrice()));
|
||||
kakaoVO.setMmsPrice(Float.parseFloat(sendVO.getMmsPrice()));
|
||||
|
||||
@ -1040,14 +995,7 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@ -1077,39 +1025,12 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
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
|
||||
@ -1140,8 +1061,7 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
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.setAtDelayYn(kakaoVO.getAtSmishingYn());
|
||||
sendVO.setBizKakaoResendOrgnlTxt(kakaoVO.getSubMsgTxt());
|
||||
sendVO.setBizKakaoResendType(sendVO.getSubMsgType());
|
||||
|
||||
@ -1256,31 +1176,31 @@ public class KakaoAlimTalkServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public KakaoReturnVO createKaKaoProfile(KakaoVO kakaoVO) throws Exception {
|
||||
KakaoReturnVO returnVO = new KakaoReturnVO();
|
||||
|
||||
/* 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("삭제 발신프로필의 복구가 완료 되었습니다.");
|
||||
}else {
|
||||
kakaoApiService.insertKakaoProfileInfo(kakaoVO);
|
||||
returnVO.setBizReturnMsg("발신프로필의 등록이 완료 되었습니다.");
|
||||
}
|
||||
|
||||
}
|
||||
return returnVO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -96,10 +96,7 @@ public class KakaoAlimTalkController {
|
||||
|
||||
KakaoReturnVO tmpProfileVO = kakaoApiProfile.kakaoApiProfileList(kakaoProfileVO);
|
||||
|
||||
/* API를 통하여 정상적으로 조회된 프로필만 add 처리 */
|
||||
if("200".equals(tmpProfileVO.getBizReturnCode())) {
|
||||
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,16 +269,70 @@ 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");
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
modelAndView.addObject("message", egovMessageSource.getMessage("fail.common.update"));
|
||||
|
||||
@ -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;
|
||||
@ -63,6 +61,7 @@ import itn.com.cmm.util.MJUtil;
|
||||
import itn.com.cmm.util.StringUtil;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
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.KakaoApiJsonSave;
|
||||
@ -80,9 +79,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 +102,6 @@ import itn.let.uss.umt.service.UserManageVO;
|
||||
@Controller
|
||||
public class KakaoAlimTalkSendController {
|
||||
|
||||
private final OrgChartManageController orgChartManageController;
|
||||
|
||||
@Resource(name = "egovMjonMsgGroupIdGnrService")
|
||||
private EgovIdGnrService idgenMjonMsgGroupId;
|
||||
|
||||
@ -156,13 +150,6 @@ public class KakaoAlimTalkSendController {
|
||||
@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
|
||||
, @ModelAttribute("kakaoVO") KakaoVO kakaoVO) throws Exception {
|
||||
@ -841,13 +828,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 +850,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"));
|
||||
@ -1553,55 +1540,4 @@ public class KakaoAlimTalkSendController {
|
||||
|
||||
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,8 +113,9 @@ public class KakaoFriendsTalkSendController {
|
||||
|
||||
model.addAttribute("loginVO", loginVO);
|
||||
|
||||
try {
|
||||
|
||||
if(!"".equals(userId) && !"ROLE_ADMIN".equals(author)) {
|
||||
if(!userId.equals("") && !author.equals("ROLE_ADMIN")) {
|
||||
|
||||
//사용자 등록 발신프로필 정보 조회해오기
|
||||
kakaoVO.setUserId(userId);
|
||||
@ -170,10 +164,10 @@ public class KakaoFriendsTalkSendController {
|
||||
String chkDate = format.format(cal.getTime());
|
||||
searchVO.setUserId(userId);
|
||||
searchVO.setMyMsgStDt(chkDate); //검색 시작일 저장 - 현재날짜로 부터 3일 이전 날짜로 시작
|
||||
// model.addAttribute("resultLatestMsgList", mjonMsgDataService.selectLatestMsgList(searchVO));
|
||||
model.addAttribute("resultLatestMsgList", mjonMsgDataService.selectLatestMsgList(searchVO));
|
||||
|
||||
//자주보내는 번호
|
||||
// model.addAttribute("resultBookMarkMsgList", mjonMsgDataService.selectBookMarkMsgList(searchVO));
|
||||
model.addAttribute("resultBookMarkMsgList", mjonMsgDataService.selectBookMarkMsgList(searchVO));
|
||||
|
||||
// 사용자 정의 단가 정보 불러오기(시스템 단가 혹은 협의 단가)
|
||||
model.addAttribute("sendPrice", kakaoSendUtil.selectSendPriceOfKakaoAtAndSmsAndMms(userId));
|
||||
@ -225,6 +219,10 @@ public class KakaoFriendsTalkSendController {
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println(" kakaoFriendsTalkMsgDataViewDataRegist Error ::: " + e);
|
||||
}
|
||||
|
||||
return "web/kakao/msgdata/ft/KakaoFriendsTalkMsgDataView";
|
||||
}
|
||||
|
||||
@ -316,28 +314,6 @@ public class KakaoFriendsTalkSendController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @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
|
||||
@ -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 {
|
||||
|
||||
@ -183,67 +172,6 @@ public class KakaoFriendsTalkTemplateController {
|
||||
}
|
||||
|
||||
|
||||
@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
|
||||
, "오류가 발생하였습니다."
|
||||
, ""
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 카카오 친구톡 템플릿 등록요청
|
||||
/**
|
||||
* @methodName : insertKakaoFriendsTemplateDataAjax
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -6,11 +6,9 @@ import java.util.List;
|
||||
import itn.let.uss.umt.service.UserDefaultVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class KakaoSentVO extends UserDefaultVO{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -114,7 +112,6 @@ public class KakaoSentVO extends UserDefaultVO{
|
||||
|
||||
private String successPrice;
|
||||
private String kakaoResendSuccPrice;
|
||||
private String bizKakaoImageType;
|
||||
|
||||
private String divideYn;
|
||||
|
||||
@ -122,6 +119,4 @@ public class KakaoSentVO extends UserDefaultVO{
|
||||
|
||||
private String yellowId;
|
||||
|
||||
private String adFlag;
|
||||
|
||||
}
|
||||
|
||||
@ -34,15 +34,12 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import itn.com.cmm.util.StringUtil;
|
||||
import itn.let.kakao.admin.kakaoAt.service.MjonKakaoATVO;
|
||||
import itn.let.kakao.user.sent.service.KakaoSentDetailVO;
|
||||
import itn.let.kakao.user.sent.service.KakaoSentService;
|
||||
import itn.let.kakao.user.sent.service.KakaoSentVO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgSentVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Service("KakaoSentService")
|
||||
public class KakaoSentServiceImpl extends EgovAbstractServiceImpl implements KakaoSentService{
|
||||
|
||||
@ -142,17 +139,8 @@ public class KakaoSentServiceImpl extends EgovAbstractServiceImpl implements Ka
|
||||
|
||||
List<KakaoSentVO> resultList = new ArrayList<KakaoSentVO>();
|
||||
|
||||
|
||||
//수신번호 검색 시 번호 포멧 통일
|
||||
if("4".equals(kakaoSentVO.getSearchCondition()) && StringUtil.isNotEmpty(kakaoSentVO.getSearchKeyword())) {
|
||||
kakaoSentVO.setSearchKeyword(kakaoSentVO.getSearchKeyword().trim().replace("-", ""));
|
||||
}
|
||||
|
||||
resultList = kakaoSentDAO.selectAllKakaoSentList_advc(kakaoSentVO);
|
||||
|
||||
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
|
||||
|
||||
//totPrice 계산 및 상태코드 set
|
||||
resultList = resultList.stream().map(t -> setPriceNCode(t)).collect(Collectors.toList());
|
||||
|
||||
@ -254,7 +242,7 @@ public class KakaoSentServiceImpl extends EgovAbstractServiceImpl implements Ka
|
||||
int failed = 0; // 실패 건수
|
||||
if("Y".equals(resultVO.getBizKakaoResendYn())) {
|
||||
success = resultVO.getSuccessCount() + resultVO.getKakaoResendSuccCount();
|
||||
failed = resultVO.getFailCount() - resultVO.getKakaoResendSuccCount();
|
||||
failed = resultVO.getKakaoResendFailCount();
|
||||
}else {
|
||||
success = resultVO.getSuccessCount();
|
||||
failed = resultVO.getFailCount();
|
||||
@ -266,8 +254,8 @@ public class KakaoSentServiceImpl extends EgovAbstractServiceImpl implements Ka
|
||||
String failedPct = total > 0 ? String.format("%.1f%%", (failed / (double) total) * 100) : "0.0%";
|
||||
|
||||
resultVO.setSuccessPct(successPct);
|
||||
resultVO.setFailedPct(failedPct);
|
||||
resultVO.setWaitingPct(waitingPct);
|
||||
resultVO.setFailedPct(waitingPct);
|
||||
resultVO.setWaitingPct(failedPct);
|
||||
|
||||
resultVO.setTotPrice(this.priceProc(resultVO.getSuccessPrice(), resultVO.getKakaoResendSuccPrice()));
|
||||
|
||||
@ -299,27 +287,14 @@ public class KakaoSentServiceImpl extends EgovAbstractServiceImpl implements Ka
|
||||
* */
|
||||
private KakaoSentVO setPriceNCode(KakaoSentVO result) {
|
||||
|
||||
log.info("=============================== setPriceNCode ================================");
|
||||
|
||||
//성공 건수 세팅
|
||||
KakaoSentVO eachCnt = new KakaoSentVO();
|
||||
eachCnt.setMsgGroupId(result.getMsgGroupId());
|
||||
eachCnt.setBizKakaoResendYn("Y".equals(result.getBizKakaoResendYn()) ? "Y" : "N");
|
||||
eachCnt.setMsgType(result.getMsgType());
|
||||
eachCnt.setBizKakaoImageType(result.getBizKakaoImageType());
|
||||
eachCnt.setBizKakaoResendType(result.getBizKakaoResendType());
|
||||
|
||||
try {
|
||||
log.info("eachCnt.getMsgType() :: [{}]", eachCnt.getMsgType());
|
||||
log.info("eachCnt.getBizKakaoImageType() :: [{}]", eachCnt.getBizKakaoImageType());
|
||||
log.info("eachCnt.getBizKakaoResendType() :: [{}]", eachCnt.getBizKakaoResendType());
|
||||
|
||||
eachCnt = kakaoSentDAO.selectKakaoSentCntEachCnt_advc(eachCnt);
|
||||
} catch (Exception e) {
|
||||
System.out.println("setPriceNCode error!!");
|
||||
}
|
||||
log.info(" + eachCnt.toString() :: [{}]", eachCnt.toString());
|
||||
// log.info(" + eachCnt.getSuccessPrice() :: [{}]", eachCnt.getSuccessPrice());
|
||||
|
||||
result.setSuccessCount(eachCnt.getSuccessCount());
|
||||
result.setWaitCount(eachCnt.getWaitCount());
|
||||
@ -352,9 +327,9 @@ public class KakaoSentServiceImpl extends EgovAbstractServiceImpl implements Ka
|
||||
|
||||
//총금액 시작
|
||||
//=======================================================
|
||||
// TotPrice : 성공건수에 대한 금액 곱하기 ? : null 처리
|
||||
BigDecimal atPrice = successPrice != null ? new BigDecimal(successPrice) : BigDecimal.ZERO;
|
||||
BigDecimal kakaoResendPrice = kakaoResendSuccPrice != null ? new BigDecimal(kakaoResendSuccPrice) : BigDecimal.ZERO;
|
||||
// TotPrice : 성공건수에 대한 금액 곱하기
|
||||
BigDecimal atPrice = new BigDecimal(successPrice);
|
||||
BigDecimal kakaoResendPrice = new BigDecimal(kakaoResendSuccPrice);
|
||||
BigDecimal totalPrice = atPrice.add(kakaoResendPrice);
|
||||
// 소수점 한 자리로 설정 (반올림)// totalPrice 값을 소수점 한 자리까지 반올림하여 roundedTotalPrice에 저장
|
||||
// RoundingMode.HALF_UP: 반올림 방식으로, 소수점 기준 5 이상이면 올림, 그렇지 않으면 내림
|
||||
@ -660,7 +635,7 @@ public class KakaoSentServiceImpl extends EgovAbstractServiceImpl implements Ka
|
||||
data[i][1] = sdf.format(vo.getReqdate());
|
||||
|
||||
//구분
|
||||
data[i][2] = "A".equals(vo.getSendKind()) ? "API" : "WEB";
|
||||
data[i][2] = "H".equals(vo.getSendKind()) ? "WEB" : "API";
|
||||
|
||||
//채널ID
|
||||
data[i][3] = vo.getYellowId();
|
||||
|
||||
@ -2,7 +2,6 @@ package itn.let.kakao.user.sent.web;
|
||||
|
||||
import java.io.FileReader;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import itn.com.cmm.util.DateUtils;
|
||||
import java.text.SimpleDateFormat;
|
||||
@ -39,7 +38,6 @@ import itn.com.cmm.LoginVO;
|
||||
import itn.com.cmm.util.StringUtil;
|
||||
import itn.com.cmm.util.StringUtil2;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.cmm.vo.FileInfoVO;
|
||||
import itn.let.kakao.admin.kakaoAt.service.MjonKakaoATVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoButtonVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoReturnVO;
|
||||
@ -48,20 +46,13 @@ import itn.let.kakao.kakaoComm.kakaoApi.KakaoApiTemplate;
|
||||
import itn.let.kakao.user.sent.service.KakaoSentDetailVO;
|
||||
import itn.let.kakao.user.sent.service.KakaoSentService;
|
||||
import itn.let.kakao.user.sent.service.KakaoSentVO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgSentVO;
|
||||
import itn.let.mjo.msgsent.service.impl.MjonMsgSentDAO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
public class KakaoSentController {
|
||||
|
||||
@Resource(name = "KakaoSentService")
|
||||
private KakaoSentService kakaoSentService;
|
||||
|
||||
@Resource(name="MjonMsgSentDAO")
|
||||
private MjonMsgSentDAO mjonMsgSentDAO;
|
||||
|
||||
@Autowired
|
||||
KakaoApiTemplate kakaoApiTemplate;
|
||||
|
||||
@ -191,7 +182,7 @@ public class KakaoSentController {
|
||||
|
||||
//전체 발송 리스트 불러오기
|
||||
List<KakaoSentVO> resultAllSentList = kakaoSentService.selectAllKakaoSentList(kakaoSentVO);
|
||||
|
||||
System.out.println("??");
|
||||
model.addAttribute("resultAllSentList", resultAllSentList);
|
||||
// model.addAttribute("resultAllSentCnt", resultAllSentList.size());
|
||||
|
||||
@ -272,25 +263,6 @@ public class KakaoSentController {
|
||||
|
||||
model.addAttribute("kakaoTemplateInfo", kakaoTemplateInfo);
|
||||
|
||||
if(StringUtils.isNotEmpty( mjonKakaoATResultVO.getFilePath1() )) {
|
||||
List<FileInfoVO> fileInfos = new ArrayList<>();
|
||||
|
||||
|
||||
// 확장자 제외한 파일명
|
||||
String fileId = FilenameUtils.getBaseName(mjonKakaoATResultVO.getFilePath1());
|
||||
|
||||
// 파일 정보 조회
|
||||
MjonMsgSentVO info = mjonMsgSentDAO.selectFileInfo(fileId);
|
||||
|
||||
// FileInfo 객체 생성 및 추가
|
||||
FileInfoVO fileInfo = new FileInfoVO();
|
||||
fileInfo.setAtchFileId(info.getAtchFileId());
|
||||
fileInfo.setFileSn(info.getFileSn());
|
||||
|
||||
fileInfos.add(fileInfo);
|
||||
model.addAttribute("fileInfos", fileInfos);
|
||||
}
|
||||
|
||||
}else {
|
||||
|
||||
model.addAttribute("kakaoTemplateInfo", "");
|
||||
@ -918,21 +890,22 @@ public class KakaoSentController {
|
||||
KakaoReturnVO returnVO = new KakaoReturnVO();
|
||||
try {
|
||||
|
||||
String jsonContents = kakaoATVO.getContents();
|
||||
String tmpContent = kakaoATVO.getSmsTxtTrans();
|
||||
String jsonFilePath = kakaoATVO.getBizKakaoJsonFile();
|
||||
|
||||
//친구톡 이미지 또는 버튼 정보가 있다면 실행
|
||||
if(jsonContents != null && jsonContents.length() > 0) {
|
||||
if(jsonFilePath != null && jsonFilePath.length() > 0) {
|
||||
|
||||
/*FileReader reader = new FileReader(jsonFilePath);
|
||||
FileReader reader = new FileReader(jsonFilePath);
|
||||
int ch;
|
||||
String resultStr = "";
|
||||
while ((ch = reader.read()) != -1) {
|
||||
|
||||
resultStr = resultStr + (char)ch;
|
||||
}
|
||||
*/
|
||||
|
||||
JSONParser parser = new JSONParser();
|
||||
Object obj = parser.parse(jsonContents);
|
||||
Object obj = parser.parse(resultStr);
|
||||
JSONObject object = (JSONObject) obj;
|
||||
|
||||
String image = (object.get("image") == null) ? null : object.get("image").toString();
|
||||
@ -991,7 +964,7 @@ public class KakaoSentController {
|
||||
}
|
||||
|
||||
//친구톡 내용 셋팅
|
||||
returnVO.setTemplateContent(kakaoATVO.getSmsTxt());
|
||||
returnVO.setTemplateContent(tmpContent);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -1064,14 +1037,10 @@ public class KakaoSentController {
|
||||
|
||||
|
||||
|
||||
try {
|
||||
|
||||
//발송 관리 문자발송 내용 상세보기 팝업 => 문자내용(MJ_MSG_DATA)
|
||||
MjonKakaoATVO mjonKakaoATResultVO = kakaoSentService.selectKakaoSentDetailDataAjax(mjonKakaoATVO);
|
||||
// 대체문자 엔터키 치환
|
||||
if(StringUtils.isNotEmpty(mjonKakaoATResultVO.getSmsTxt())) {
|
||||
mjonKakaoATResultVO.setSmsTxt(StringUtil2.replaceBR(mjonKakaoATResultVO.getSmsTxt()));
|
||||
}
|
||||
model.addAttribute("resultMsgDetail", mjonKakaoATResultVO);
|
||||
|
||||
String msgType = mjonKakaoATResultVO.getMsgType();
|
||||
@ -1093,41 +1062,17 @@ public class KakaoSentController {
|
||||
//String smsTxt = mjonKakaoATResultVO.getSmsTxt();
|
||||
|
||||
KakaoReturnVO kakaoTemplateInfo = getKakaoFTSendTemplateInfo(mjonKakaoATResultVO);
|
||||
model.addAttribute("kakaoTemplateInfo", kakaoTemplateInfo);
|
||||
|
||||
if(StringUtils.isNotEmpty( mjonKakaoATResultVO.getFilePath1() )) {
|
||||
List<FileInfoVO> fileInfos = new ArrayList<>();
|
||||
|
||||
|
||||
// 확장자 제외한 파일명
|
||||
String fileId = FilenameUtils.getBaseName(mjonKakaoATResultVO.getFilePath1());
|
||||
|
||||
// 파일 정보 조회
|
||||
MjonMsgSentVO info = mjonMsgSentDAO.selectFileInfo(fileId);
|
||||
|
||||
// FileInfo 객체 생성 및 추가
|
||||
FileInfoVO fileInfo = new FileInfoVO();
|
||||
fileInfo.setAtchFileId(info.getAtchFileId());
|
||||
fileInfo.setFileSn(info.getFileSn());
|
||||
|
||||
fileInfos.add(fileInfo);
|
||||
model.addAttribute("fileInfos", fileInfos);
|
||||
}
|
||||
//kakaoTemplateInfo.setTemplateContent(smsTxt);
|
||||
|
||||
model.addAttribute("kakaoTemplateInfo", kakaoTemplateInfo);
|
||||
|
||||
}else {
|
||||
|
||||
model.addAttribute("kakaoTemplateInfo", "");
|
||||
|
||||
}
|
||||
|
||||
model.addAttribute("msgType", msgType);
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// TODO: handle exception
|
||||
}
|
||||
return "web/kakao/sent/KakaoSentDetailPhoneAjax";
|
||||
return "web/kakao/sent/KakaoSentDetailPopAjax";
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,11 +85,10 @@ public class KakaoStepInfoController {
|
||||
String bbsId = "";
|
||||
|
||||
String serverName = request.getServerName();//URL 도메인정보 받아오기
|
||||
System.out.println("serverName : "+ serverName);
|
||||
if(serverName.equals("www.munjaon.co.kr")) {//운영서버 카카오 사용안내 FAQ 게시판 번호 셋팅해주기
|
||||
bbsId = "BBSMSTR_000000000782";
|
||||
}else {//개발서버 카카오 사용안내 FAQ 게시판 번호 셋팅해주기
|
||||
bbsId = "BBSMSTR_000000000782";
|
||||
bbsId = "BBSMSTR_000000000791";
|
||||
}
|
||||
|
||||
boardVO.setBbsId(bbsId);
|
||||
@ -114,7 +113,7 @@ public class KakaoStepInfoController {
|
||||
boardVO.setRecordCountPerPage(100);
|
||||
|
||||
map = bbsMngService.selectBoardArticlesWeb(boardVO, null);
|
||||
System.out.println("????????????????????????????????");
|
||||
|
||||
int totCnt = Integer.parseInt((String) map.get("resultCnt"));
|
||||
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
@ -188,29 +187,6 @@ public class KakaoStepInfoController {
|
||||
return "/web/kakao/intrd/KakaoAllimtalkIntro";
|
||||
}
|
||||
|
||||
/**
|
||||
* @Method Name : kakaotalkIntrdView
|
||||
* @Project : mjon
|
||||
* @Date : 2025. 8. 21
|
||||
* @작성자 : 원영현
|
||||
|
||||
* @프로그램 설명 :카카오 알림톡, 친구토 통합 소개페이지
|
||||
*/
|
||||
@RequestMapping(value= {"/web/mjon/kakao/alimtalk/kakaotalkIntrdView.do"})
|
||||
public String kakaotalkIntrdView(HttpServletRequest request,
|
||||
@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, ModelMap model , BoardVO boardVO ,
|
||||
RedirectAttributes redirectAttributes) throws Exception {
|
||||
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
if(userId == "") {
|
||||
return "redirect:/web/user/login/login.do";
|
||||
}
|
||||
model.addAttribute("loginVO", loginVO);
|
||||
|
||||
return "/web/kakao/intrd/KakaotalkIntro";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* XSS 방지 처리.
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
package itn.let.mail.service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import itn.let.mjo.pay.service.RefundVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
@ -60,8 +57,6 @@ public class StatusResponse {
|
||||
|
||||
private Object object;
|
||||
|
||||
private Object apiReturn;
|
||||
|
||||
private String messageTemp;
|
||||
|
||||
private LocalDateTime timestamp;
|
||||
@ -96,48 +91,14 @@ public class StatusResponse {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
|
||||
public StatusResponse(HttpStatus status, String message, Object object) {
|
||||
this.status = status;
|
||||
this.message = message;
|
||||
this.object = object;
|
||||
}
|
||||
public StatusResponse(HttpStatus status, String message
|
||||
, Object object
|
||||
, Object apiReturn
|
||||
) {
|
||||
this.status = status;
|
||||
this.message = message;
|
||||
this.object = object;
|
||||
this.apiReturn = apiReturn;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : statusResponseSet
|
||||
* @author : 이호영
|
||||
* @date : 2025. 6. 24.
|
||||
* @description :
|
||||
* @return : StatusResponse
|
||||
* @param statusResponse
|
||||
* @param httpStatus
|
||||
* @param msg
|
||||
* @param statCode - statCode는 API RETURN를 위한 코드
|
||||
* @return
|
||||
*
|
||||
*/
|
||||
public static StatusResponse statusResponseSet(StatusResponse statusResponse, HttpStatus httpStatus, String msg, String statCode ) {
|
||||
statusResponse.setStatus(httpStatus);
|
||||
statusResponse.setMessage(msg);
|
||||
|
||||
Map<String, Object> apiReturnMap = new HashMap<>();
|
||||
apiReturnMap.put("statCode", statCode);
|
||||
apiReturnMap.put("result", httpStatus.toString());
|
||||
statusResponse.setApiReturn(apiReturnMap);
|
||||
|
||||
return statusResponse;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -25,7 +25,6 @@ import itn.com.cmm.EgovMessageSource;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.com.cmm.util.RedirectUrlMaker;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.cert.phone.service.MberCertPhoneVO;
|
||||
import itn.let.mjo.addr.service.AddrGroupService;
|
||||
import itn.let.mjo.addr.service.AddrGroupVO;
|
||||
import itn.let.mjo.addr.service.AddrService;
|
||||
@ -73,9 +72,6 @@ public class AddrGroupController {
|
||||
@Resource(name = "mberManageService")
|
||||
private EgovMberManageService mberManageService;
|
||||
|
||||
@Resource(name = "KmcCertChecker")
|
||||
private KmcCertChecker kmcCertChecker;
|
||||
|
||||
/**
|
||||
* 주소록 그룹 리스트
|
||||
* @param addrGroupVO
|
||||
@ -937,24 +933,21 @@ public class AddrGroupController {
|
||||
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";
|
||||
// }
|
||||
KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
|
||||
MberCertPhoneVO mberCertPhoneVO = new MberCertPhoneVO();
|
||||
mberCertPhoneVO.setTrUrl("/web/cop/kmc/authRequestAddrSubmitAjax.do");
|
||||
mberCertPhoneVO.setPlusInfo(mberManageVO.getMberId());
|
||||
// mberId null일경우 ""로
|
||||
mberManageVO.setMberId(EgovStringUtil.isNullToString(mberManageVO.getMberId()));
|
||||
|
||||
AuthCertVO certVO = kmcCertChecker.authCertCheck(mberCertPhoneVO, request);
|
||||
// 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());
|
||||
@ -979,16 +972,241 @@ public class AddrGroupController {
|
||||
*/
|
||||
|
||||
@RequestMapping("/web/cop/kmc/authRequestAddrSubmitAjax.do")
|
||||
public String authRequestFindIdPwAjax(
|
||||
HttpServletRequest request
|
||||
, HttpServletResponse response
|
||||
, ModelMap model
|
||||
, @RequestParam Map<String, Object> commandMap
|
||||
, @ModelAttribute("searchVO") KmcVO kmcVO
|
||||
, RedirectAttributes redirectAttributes
|
||||
) throws Exception {
|
||||
public String authRequestFindIdPwAjax(HttpServletRequest request, ModelMap model,
|
||||
@RequestParam Map<String, Object> commandMap, @ModelAttribute("searchVO") KmcVO kmcVO,
|
||||
RedirectAttributes redirectAttributes) throws Exception {
|
||||
|
||||
kmcVO = kmcCertChecker.authCertResult(request, response, model);
|
||||
String errMessage = ""; // 에러메세지
|
||||
|
||||
String rec_cert = ""; // 결과값(암호화)
|
||||
String certNum = ""; // certNum
|
||||
|
||||
rec_cert = request.getParameter("rec_cert").trim();
|
||||
certNum = request.getParameter("certNum").trim();
|
||||
|
||||
kmcVO.setRecCert(rec_cert);
|
||||
kmcVO.setCertNum(certNum);
|
||||
// 파라미터 유효성 검증
|
||||
if (rec_cert.length() == 0 || certNum.length() == 0) {
|
||||
errMessage = "비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
// 변수선언
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
String k_certNum = ""; // 파라미터로 수신한 요청번호
|
||||
k_certNum = certNum;
|
||||
String date = ""; // 요청일시
|
||||
String CI = ""; // 연계정보(CI)
|
||||
String DI = ""; // 중복가입확인정보(DI)
|
||||
String phoneNo = ""; // 휴대폰번호
|
||||
String phoneCorp = ""; // 이동통신사
|
||||
String birthDay = ""; // 생년월일
|
||||
String gender = ""; // 성별
|
||||
String nation = ""; // 내국인
|
||||
String name = ""; // 성명
|
||||
String M_name = ""; // 미성년자 성명
|
||||
String M_birthDay = ""; // 미성년자 생년월일
|
||||
String M_Gender = ""; // 미성년자 성별
|
||||
String M_nation = ""; // 미성년자 내외국인
|
||||
String result = ""; // 결과값
|
||||
|
||||
String certMet = ""; // 인증방법
|
||||
String ip = ""; // ip주소
|
||||
String plusInfo = "";
|
||||
|
||||
String encPara = "";
|
||||
String encMsg1 = "";
|
||||
String encMsg2 = "";
|
||||
String msgChk = "";
|
||||
|
||||
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||
|
||||
// 02. 1차 복호화
|
||||
// 수신된 certNum를 이용하여 복호화
|
||||
rec_cert = seed.getDec(rec_cert, k_certNum);
|
||||
|
||||
// 03. 1차 파싱
|
||||
int inf1 = rec_cert.indexOf("/", 0);
|
||||
int inf2 = rec_cert.indexOf("/", inf1 + 1);
|
||||
|
||||
encPara = rec_cert.substring(0, inf1); // 암호화된 통합 파라미터
|
||||
encMsg1 = rec_cert.substring(inf1 + 1, inf2); // 암호화된 통합 파라미터의 Hash값
|
||||
|
||||
// 04. 위변조 검증
|
||||
encMsg2 = seed.getMsg(encPara);
|
||||
kmcVO.setEncMsg2(encMsg2);
|
||||
if (encMsg2.equals(encMsg1)) {
|
||||
msgChk = "Y";
|
||||
}
|
||||
|
||||
if (!"Y".equals(msgChk)) {
|
||||
errMessage = "비정상접근입니다.";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
// 05. 2차 복호화
|
||||
rec_cert = seed.getDec(encPara, k_certNum);
|
||||
kmcVO.setRecCert(rec_cert);
|
||||
// 06. 2차 파싱
|
||||
int info1 = rec_cert.indexOf("/", 0);
|
||||
int info2 = rec_cert.indexOf("/", info1 + 1);
|
||||
int info3 = rec_cert.indexOf("/", info2 + 1);
|
||||
int info4 = rec_cert.indexOf("/", info3 + 1);
|
||||
int info5 = rec_cert.indexOf("/", info4 + 1);
|
||||
int info6 = rec_cert.indexOf("/", info5 + 1);
|
||||
int info7 = rec_cert.indexOf("/", info6 + 1);
|
||||
int info8 = rec_cert.indexOf("/", info7 + 1);
|
||||
int info9 = rec_cert.indexOf("/", info8 + 1);
|
||||
int info10 = rec_cert.indexOf("/", info9 + 1);
|
||||
int info11 = rec_cert.indexOf("/", info10 + 1);
|
||||
int info12 = rec_cert.indexOf("/", info11 + 1);
|
||||
int info13 = rec_cert.indexOf("/", info12 + 1);
|
||||
int info14 = rec_cert.indexOf("/", info13 + 1);
|
||||
int info15 = rec_cert.indexOf("/", info14 + 1);
|
||||
int info16 = rec_cert.indexOf("/", info15 + 1);
|
||||
int info17 = rec_cert.indexOf("/", info16 + 1);
|
||||
int info18 = rec_cert.indexOf("/", info17 + 1);
|
||||
|
||||
certNum = rec_cert.substring(0, info1);
|
||||
kmcVO.setCertNum(certNum);
|
||||
date = rec_cert.substring(info1 + 1, info2);
|
||||
kmcVO.setDate(date);
|
||||
CI = rec_cert.substring(info2 + 1, info3);
|
||||
kmcVO.setCI(CI);
|
||||
phoneNo = rec_cert.substring(info3 + 1, info4);
|
||||
kmcVO.setPhoneNo(phoneNo);
|
||||
phoneCorp = rec_cert.substring(info4 + 1, info5);
|
||||
kmcVO.setPhoneCorp(phoneCorp);
|
||||
birthDay = rec_cert.substring(info5 + 1, info6);
|
||||
kmcVO.setBirthDay(birthDay);
|
||||
gender = rec_cert.substring(info6 + 1, info7);
|
||||
kmcVO.setGender(gender);
|
||||
nation = rec_cert.substring(info7 + 1, info8);
|
||||
kmcVO.setNation(nation);
|
||||
name = rec_cert.substring(info8 + 1, info9);
|
||||
kmcVO.setName(name);
|
||||
result = rec_cert.substring(info9 + 1, info10);
|
||||
kmcVO.setResult(result);
|
||||
certMet = rec_cert.substring(info10 + 1, info11);
|
||||
kmcVO.setCertMet(certMet);
|
||||
ip = rec_cert.substring(info11 + 1, info12);
|
||||
kmcVO.setIp(ip);
|
||||
M_name = rec_cert.substring(info12 + 1, info13);
|
||||
kmcVO.setMName(M_name);
|
||||
M_birthDay = rec_cert.substring(info13 + 1, info14);
|
||||
kmcVO.setMBirthDay(M_birthDay);
|
||||
M_Gender = rec_cert.substring(info14 + 1, info15);
|
||||
kmcVO.setMGender(M_Gender);
|
||||
M_nation = rec_cert.substring(info15 + 1, info16);
|
||||
kmcVO.setMNation(M_nation);
|
||||
plusInfo = rec_cert.substring(info16 + 1, info17);
|
||||
kmcVO.setPlusInfo(plusInfo);
|
||||
DI = rec_cert.substring(info17 + 1, info18);
|
||||
kmcVO.setDI(DI);
|
||||
|
||||
// 07. CI, DI 복호화
|
||||
CI = seed.getDec(CI, k_certNum);
|
||||
kmcVO.setCI(CI);
|
||||
DI = seed.getDec(DI, k_certNum);
|
||||
kmcVO.setDI(DI);
|
||||
|
||||
if ("Y".equals(result)) {
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
String regex = "";
|
||||
if (certNum.length() == 0 || certNum.length() > 40) {
|
||||
errMessage = "요청번호 비정상.";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (date.length() != 14 || !paramChk(regex, date)) {
|
||||
errMessage = "요청일시";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if (certMet.length() != 1 || !paramChk(regex, certMet)) {
|
||||
errMessage = "본인인증방법 비정상" + certMet;
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if ((phoneNo.length() != 10 && phoneNo.length() != 11) || !paramChk(regex, phoneNo)) {
|
||||
errMessage = "휴대폰번호 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if (phoneCorp.length() != 3 || !paramChk(regex, phoneCorp)) {
|
||||
errMessage = "이동통신사 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (birthDay.length() != 8 || !paramChk(regex, birthDay)) {
|
||||
errMessage = "생년월일 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (gender.length() != 1 || !paramChk(regex, gender)) {
|
||||
errMessage = "성별 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (nation.length() != 1 || !paramChk(regex, nation)) {
|
||||
errMessage = "내/외국인 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-<2D>R.,-]*";
|
||||
if (name.length() > 60 || !paramChk(regex, name)) {
|
||||
errMessage = "성명 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if (result.length() != 1 || !paramChk(regex, result)) {
|
||||
errMessage = "결과값 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-?.,-]*";
|
||||
if (M_name.length() != 0) {
|
||||
if (M_name.length() > 60 || !paramChk(regex, M_name)) {
|
||||
errMessage = "미성년자 성명 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (M_birthDay.length() != 0) {
|
||||
if (M_birthDay.length() != 8 || !paramChk(regex, M_birthDay)) {
|
||||
errMessage = "미성년자 생년월일 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (M_Gender.length() != 0) {
|
||||
if (M_Gender.length() != 1 || !paramChk(regex, M_Gender)) {
|
||||
errMessage = "미성년자 성별 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (M_nation.length() != 0) {
|
||||
if (M_nation.length() != 1 || !paramChk(regex, M_nation)) {
|
||||
errMessage = "미성년자 내/외국인 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
}
|
||||
|
||||
// KMC 본인인증 로그
|
||||
AuthCertVO certVO = new AuthCertVO();
|
||||
|
||||
@ -0,0 +1,87 @@
|
||||
package itn.let.mjo.api.sms.web;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
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.RequestParam;
|
||||
import org.springframework.web.servlet.HandlerMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
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.util.RedirectUrlMaker;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.mjo.apikey.service.ApiCallInfoMngService;
|
||||
import itn.let.mjo.apikey.service.ApiKeyMngService;
|
||||
import itn.let.mjo.apikey.service.ApiKeyVO;
|
||||
import itn.let.mjo.mjocommon.MjonCommon;
|
||||
import itn.let.mjo.msg.service.MjonMsgService;
|
||||
import itn.let.sym.site.service.EgovSiteManagerService;
|
||||
import itn.let.sym.site.service.JoinSettingVO;
|
||||
import itn.let.uss.umt.service.EgovUserManageService;
|
||||
import itn.let.utl.user.service.MjonNoticeSendUtil;
|
||||
import itn.let.utl.user.service.SecuKeyUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author api key manager
|
||||
* @since 2021.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2021.03.20 신명섭 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class ApiSmsTestMsgController {
|
||||
|
||||
/**
|
||||
* @methodName : ussIonApikeyUserAPIKEYList
|
||||
* @author : 이호영
|
||||
* @date : 2025. 4. 29.
|
||||
* @description : api 문자 발송 테스트
|
||||
* @return : String
|
||||
* @param searchVO
|
||||
* @param request
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
@RequestMapping(value= {"/uss/ion/api/test/sms/sendMsgForm.do"})
|
||||
public String sendMsgForm(@ModelAttribute("searchVO") ApiKeyVO searchVO,
|
||||
HttpServletRequest request ,
|
||||
ModelMap model) throws Exception{
|
||||
//value 값 가져오기
|
||||
|
||||
|
||||
return "/uss/ion/api/test/sms/sendMsgForm";
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value= {"/uss/ion/api/test/sms/sendMsgsForm.do"})
|
||||
public String sendMsgsForm(@ModelAttribute("searchVO") ApiKeyVO searchVO,
|
||||
HttpServletRequest request ,
|
||||
ModelMap model) throws Exception{
|
||||
//value 값 가져오기
|
||||
|
||||
|
||||
return "/uss/ion/api/test/sms/sendMsgsForm";
|
||||
|
||||
}
|
||||
}
|
||||
@ -29,6 +29,4 @@ public interface ApiCallInfoMngService {
|
||||
//api key & api info 모두 실제 삭제
|
||||
void deleteApiKeyInfoReal(ApiKeyVO apiKeyVO) throws Exception;
|
||||
|
||||
void udpateApiKeyInfoReal(ApiKeyVO apiKeyVO) throws Exception;
|
||||
|
||||
}
|
||||
@ -43,8 +43,4 @@ public class ApiCallInfoMngDAO extends EgovComAbstractDAO{
|
||||
public void deleteApiCallInfoAll(ApiKeyVO apiKeyVO) throws Exception{
|
||||
update("ApiCallInfoMngDAO.deleteApiCallInfoAll", apiKeyVO);
|
||||
}
|
||||
|
||||
public void updateApiCallInfoAll(ApiKeyVO apiKeyVO) throws Exception{
|
||||
update("ApiCallInfoMngDAO.updateApiCallInfoAll", apiKeyVO);
|
||||
}
|
||||
}
|
||||
@ -66,14 +66,4 @@ public class ApiCallInfoMngServiceImpl extends EgovAbstractServiceImpl implement
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void udpateApiKeyInfoReal(ApiKeyVO apiKeyVO) throws Exception {
|
||||
apiKeyVO.setUseYn("N");
|
||||
apiCallInfoMngDAO.updateApiCallInfoAll(apiKeyVO);
|
||||
|
||||
//api key 삭제
|
||||
apiKeyMngDAO.deleteApiKey(apiKeyVO);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -48,6 +48,10 @@ public class ApiKeyMngDAO extends EgovComAbstractDAO{
|
||||
return update("ApiKeyMngDAO.insertApiKey", apiKeyVO);
|
||||
}
|
||||
|
||||
public void deleteApiKeyReal(ApiKeyVO apiKeyVO) throws Exception{
|
||||
update("ApiKeyMngDAO.deleteApiKeyReal", apiKeyVO);
|
||||
}
|
||||
|
||||
public List<ApiKeyVO> selectApiKeyApplyStatus(ApiKeyVO apiKeyVO){
|
||||
return (List<ApiKeyVO>) list("ApiKeyMngDAO.selectApiKeyApplyStatus", apiKeyVO);
|
||||
}
|
||||
@ -56,8 +60,4 @@ public class ApiKeyMngDAO extends EgovComAbstractDAO{
|
||||
return (int) select("ApiKeyMngDAO.selectMberApiKeyChk", apiKeyVO);
|
||||
}
|
||||
|
||||
public void deleteApiKeyReal(ApiKeyVO apiKeyVO) throws Exception{
|
||||
update("ApiKeyMngDAO.deleteApiKeyReal", apiKeyVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -472,9 +472,7 @@ public class ApiKeyMngController {
|
||||
apiKeyVO.setMberId(userId);
|
||||
apiKeyVO.setAccessNo(p_accessNo);
|
||||
|
||||
// 2025.06.02 update로 수정
|
||||
// apiCallInfoMngService.deleteApiKeyInfoReal(apiKeyVO);
|
||||
apiCallInfoMngService.udpateApiKeyInfoReal(apiKeyVO);
|
||||
apiCallInfoMngService.deleteApiKeyInfoReal(apiKeyVO);
|
||||
|
||||
modelAndView.addObject("message", "삭제 완료되었습니다.");
|
||||
modelAndView.addObject("result", "success");
|
||||
|
||||
@ -3,8 +3,6 @@ package itn.let.mjo.mjocommon;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@ -18,8 +16,10 @@ import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.mysql.jdbc.StringUtils;
|
||||
|
||||
import egovframework.com.idgen.CustomIdGnrService;
|
||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
||||
@ -27,22 +27,17 @@ import itn.com.cmm.MjonMsgSendVO;
|
||||
import itn.com.cmm.OptimalMsgResultDTO;
|
||||
import itn.com.cmm.util.MsgSendUtils;
|
||||
import itn.com.cmm.util.SlackMessageFormatUtil;
|
||||
import itn.com.cmm.util.StringUtil;
|
||||
import itn.let.kakao.kakaoComm.KakaoSendAdvcVO;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.mjo.event.service.MjonEventService;
|
||||
import itn.let.mjo.event.service.MjonEventVO;
|
||||
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.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.sym.site.service.EgovSiteManagerService;
|
||||
import itn.let.sym.site.service.JoinSettingVO;
|
||||
import itn.let.uat.uia.web.SendLogVO;
|
||||
import itn.let.uss.umt.service.EgovUserManageService;
|
||||
import itn.let.uss.umt.service.UserManageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -76,12 +71,6 @@ public class MjonCommon {
|
||||
@Resource(name = "egovMjonMsgIdCGnrService")
|
||||
private CustomIdGnrService idgenMsgCId;
|
||||
|
||||
@Resource(name = "mjonMsgDAO")
|
||||
private MjonMsgDAO mjonMsgDAO;
|
||||
|
||||
@Resource(name = "MjonMsgDataService")
|
||||
private MjonMsgDataService mjonMsgDataService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -544,12 +533,12 @@ private int parseIntOrDefault(String value, int defaultValue) {
|
||||
UserManageVO userManageVO = getUserManageInfo(kakaoVO.getUserId());
|
||||
|
||||
// 기본값 처리된 사용자 정보와 문자 상태
|
||||
String adminSmsNoticeYn = userManageVO.getAdminSmsNoticeYn(); // 법인폰 알람 여부 - Y : ON
|
||||
String atSmishingYn = userManageVO.getAtSmishingYn(); // 스미싱 의심 - Y : ON
|
||||
String adminSmsNoticeYn = userManageVO.getAdminSmsNoticeYn();
|
||||
String atSmishingYn = userManageVO.getAtSmishingYn();
|
||||
|
||||
// 조건 체크
|
||||
if ("Y".equals(adminSmsNoticeYn) || "Y".equals(atSmishingYn)) {
|
||||
kakaoVO.setAtSmishingYn("Y"); // MjonMsgVO에 스미싱 정보 설정 - Y면 디
|
||||
kakaoVO.setAtSmishingYn("Y"); // MjonMsgVO에 스미싱 정보 설정
|
||||
|
||||
// 스미싱 알림 처리
|
||||
return handleSmishingAlert(); // 알림 처리 결과 반환
|
||||
@ -558,46 +547,6 @@ private int parseIntOrDefault(String value, int defaultValue) {
|
||||
return false; // 알림 처리되지 않음
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : processUserAndCheckFT
|
||||
* @author : 이호영
|
||||
* @date : 2025. 8. 21.
|
||||
* @description :
|
||||
* @return : boolean
|
||||
* @param kakaoVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*
|
||||
* @isHolidayNotified
|
||||
* @false : 알림 X
|
||||
* @true : 알림 O
|
||||
*
|
||||
*/
|
||||
public boolean processUserAndCheckFT(KakaoVO kakaoVO) throws Exception {
|
||||
// UserManageVO userManageVO = getUserManageInfo(kakaoVO.getUserId());
|
||||
// kakaoVO.setAtSmishingYn("N"); // MjonMsgVO에 스미싱 정보 설정 - Y면 딜레이 처리 됨
|
||||
|
||||
|
||||
// 기본값 처리된 사용자 정보와 문자 상태
|
||||
// String adminSmsNoticeYn = userManageVO.getAdminSmsNoticeYn(); // 법인폰 알람 여부 - Y : ON
|
||||
// String atSmishingYn = userManageVO.getAtSmishingYn(); // 스미싱 의심 - Y : ON !== mj_msg_group_data와 다른거임
|
||||
|
||||
// 조건 체크
|
||||
// if ("Y".equals(adminSmsNoticeYn) || "Y".equals(atSmishingYn)) {
|
||||
// if ("Y".equals(atSmishingYn)) {
|
||||
// Boolean B_return = handleSmishingAlert();
|
||||
// if(B_return) { // true면 알림ON이라서 스미싱Yn을 Y로 설정 아니면 N / 나머지는 로직에서 처리
|
||||
// kakaoVO.setAtSmishingYn(atSmishingYn); // MjonMsgVO에 스미싱 정보 설정 - Y면 딜레이 처리 됨
|
||||
// }
|
||||
// 스미싱 알림 처리
|
||||
// return B_return; // 알림 처리 결과 반환
|
||||
// }
|
||||
|
||||
return handleSmishingAlert(); // 알림 처리되지 않음
|
||||
}
|
||||
|
||||
|
||||
// 사용자 정보 조회 및 기본값 처리
|
||||
public UserManageVO getUserManageInfo(String userId) throws Exception {
|
||||
// UserManageVO userManageVO = new UserManageVO();
|
||||
@ -795,120 +744,8 @@ private int parseIntOrDefault(String value, int defaultValue) {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void sendMessagesIfOverFifty(int cnt, String callTo) throws Exception {
|
||||
if(
|
||||
cnt >= 50 //50건 이상일 경우만 발송
|
||||
&& StringUtil.isNotEmpty(callTo) // null, "" 체크
|
||||
&& callTo.startsWith("010") // 010으로 시작하는 휴대폰번호일 경우
|
||||
&& "Y".equals(selectSmsNotiIfOverFiftySetting()) // 안내문자 발송 on 인경우만
|
||||
&& !sysMsgTodaySendYn(callTo) // 금일 1회 이상 보낸 이력없을 경우만 발송
|
||||
) {
|
||||
|
||||
//50건이상 발송 안내문자 구분값 = 01
|
||||
String sendMsgType = "01";
|
||||
String today = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
String contents = "[인터넷 대량문자발송안내] 문자온에서 "+ callTo + " 번호로 " + today + "에 인터넷 대량 문자(50통 이상)가 발송되었습니다."
|
||||
+ "\n※ 번호도용이 의심되는 경우, 이용 중인 이동통신사의 휴대전화 번호도용 문자차단 부가서비스(무료)에 가입하여 피해를 예방할 수 있습니다.";
|
||||
this.sendSysMsg(
|
||||
"15518011"
|
||||
, callTo
|
||||
, contents
|
||||
, sendMsgType
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method Name : sendSysMsg
|
||||
* Description : 관리자 안내 문자 공통
|
||||
*
|
||||
* @param callFrom : 발신번호
|
||||
* @param callTo : 수신번호
|
||||
* @param contents : 내용
|
||||
* @param sendMsgType : 발신내용 타입 - 01: 대량문자발송안내
|
||||
* @return
|
||||
* @throws Exception
|
||||
* @return MjonMsgReturnVO 설명
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public MjonMsgReturnVO sendSysMsg(
|
||||
String callFrom
|
||||
, String callTo
|
||||
, String contents
|
||||
, String sendMsgType
|
||||
) throws Exception {
|
||||
|
||||
//결과 vo
|
||||
MjonMsgReturnVO returnVO = new MjonMsgReturnVO();
|
||||
|
||||
MjonMsgVO mjonMsgVO = new MjonMsgVO();
|
||||
mjonMsgVO.setSmsTxt(contents);
|
||||
mjonMsgVO.setReserveYn("N");
|
||||
// 시스템 문자발송 번호
|
||||
// mjonMsgVO.setCallFrom("15518011");
|
||||
mjonMsgVO.setCallFrom(callFrom);
|
||||
mjonMsgVO.setCallTo(callTo);
|
||||
|
||||
mjonMsgVO.setUserId("system");
|
||||
|
||||
/*
|
||||
* 본문길이에 따른 단문/장문 구분
|
||||
* 단문 4
|
||||
* 장문 6
|
||||
* 2000자 이상 invalid
|
||||
*/
|
||||
String msgType = MsgSendUtils.getMsgTypeWithByteValidation(new MjonMsgSendVO(), contents);//
|
||||
mjonMsgVO.setMsgType(msgType);
|
||||
|
||||
// MsgDiv - S: 단문, L: 장문, P: 그림
|
||||
if("4".equalsIgnoreCase(msgType)) {
|
||||
mjonMsgVO.setMsgDiv("S");
|
||||
}else if("6".equalsIgnoreCase(msgType)) {
|
||||
mjonMsgVO.setMsgDiv("L");
|
||||
}
|
||||
else { // invalid
|
||||
returnVO.setMsgGroupId("");
|
||||
returnVO.setSendMsgCnt("0"); // 발송 건수 저장
|
||||
returnVO.setSendMsgBlockCnt("0"); // 수신차단 건수 저장
|
||||
return returnVO;
|
||||
}
|
||||
|
||||
// 문자타입별 대표전송사 정보
|
||||
MjonMsgVO mjonMsgVO2 = new MjonMsgVO();
|
||||
mjonMsgVO2 = mjonMsgDAO.selectRepMsgAgetnInfo(mjonMsgVO);
|
||||
// 전송사 구분 코드 - 01 : 아이하트, 02 : 현대 퓨쳐넷, 03 : 아이엠오, 04 : 다우기술
|
||||
mjonMsgVO.setAgentCode(mjonMsgVO2.getAgentCode()); //전송사 선택
|
||||
// 전송금액
|
||||
mjonMsgVO.setTotPrice(mjonMsgVO2.getAgentPrice().toString()); //총금액
|
||||
mjonMsgVO.setEachPrice(mjonMsgVO2.getAgentPrice().toString()); //한건 금액
|
||||
|
||||
returnVO = mjonMsgDataService.insertSysMsgDataInfo(mjonMsgVO);
|
||||
|
||||
// 시스템 발송 로그
|
||||
SendLogVO sendLogVO = new SendLogVO();
|
||||
// SendType 1:문자로 발송 2:이메일로 발송
|
||||
sendLogVO.setSendId(returnVO.getMsgGroupId());
|
||||
sendLogVO.setSendType("1");
|
||||
sendLogVO.setFrstSendInfo(mjonMsgVO.getCallFrom());
|
||||
sendLogVO.setReceive(mjonMsgVO.getCallTo());
|
||||
sendLogVO.setContents(contents);
|
||||
sendLogVO.setSendMsgType(sendMsgType);
|
||||
|
||||
mjonMsgDataService.insertSysMsgLog(sendLogVO);
|
||||
|
||||
return returnVO;
|
||||
}
|
||||
|
||||
private Boolean sysMsgTodaySendYn(String callTo) throws Exception {
|
||||
SendLogVO sendLogVO = new SendLogVO();
|
||||
sendLogVO.setReceive(callTo);
|
||||
|
||||
return mjonMsgDataService.selectSysMsgTodaySendYn(sendLogVO);
|
||||
}
|
||||
|
||||
private String selectSmsNotiIfOverFiftySetting() throws Exception {
|
||||
JoinSettingVO joinSettingVO = egovSiteManagerService.selectAdminNotiDetail();
|
||||
return joinSettingVO.getSmsNotiIfOverFifty();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Getter
|
||||
@ -20,7 +19,6 @@ import lombok.ToString;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
public class MjonMsgVO extends ComDefaultVO{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@ -95,7 +93,6 @@ public class MjonMsgVO extends ComDefaultVO{
|
||||
private String reserveYn ; //예약문자 여부
|
||||
private String reserveCYn ; //예약문자 취소 여부
|
||||
private String cancelDate; //예약 취소 일자
|
||||
private String msgResult; //문자 발송결과 10:성공 20:실패 30:대체문자 대기 40:대체문자 성공 50:대체문자 실패
|
||||
|
||||
|
||||
private String sendRate; // 전송 배분률
|
||||
@ -168,7 +165,6 @@ public class MjonMsgVO extends ComDefaultVO{
|
||||
|
||||
private float smsPrice; // sms 단가
|
||||
private float mmsPrice; // mms 단가
|
||||
private float picturePrice; // mms 단가
|
||||
private float kakaoAtPrice; // 카카오 알림톡 단가
|
||||
private float kakaoFtPrice; // 카카오 친구톡 단가
|
||||
private float kakaoFtImgPrice;// 카카오 이미지 단가
|
||||
@ -306,8 +302,6 @@ public class MjonMsgVO extends ComDefaultVO{
|
||||
private String bizLogCallStatusTxt; //다우기술 biz_log 테이블의 발송결과 내용 텍스트.
|
||||
private String bizLogStatus; //다우기술 biz_log 테이블의 전송상태값
|
||||
|
||||
private String bizKakaoImageType; // 비즈 발송 img 값
|
||||
|
||||
private String accessKey; // 'API Key',
|
||||
|
||||
private int regCount;
|
||||
@ -320,7 +314,4 @@ public class MjonMsgVO extends ComDefaultVO{
|
||||
|
||||
private List<MjonMsgSendVO> mjonMsgSendVOList = new ArrayList<>();
|
||||
|
||||
private String cmId; //다우기술 cmId
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -455,11 +455,6 @@ public class MjonMsgDAO extends EgovAbstractDAO {
|
||||
update("mjonMsgDAO.updateKakaoAtDelayCancelMsgDataFlag", mjonMsgVO);
|
||||
}
|
||||
|
||||
// mj_msg_data 테이블 지연 알림톡 취소 값 수정
|
||||
public void updateRefundY(MjonMsgVO mjonMsgVO) {
|
||||
update("mjonMsgDAO.updateRefundY", mjonMsgVO);
|
||||
}
|
||||
|
||||
// mj_msg_group_data 테이블 지연 알림톡 취소 값 수정
|
||||
public void updateKakaoAtDelayCancelMsgGroupDataFlag(MjonMsgVO mjonMsgVO) {
|
||||
update("mjonMsgDAO.updateKakaoAtDelayCancelMsgGroupDataFlag", mjonMsgVO);
|
||||
|
||||
@ -211,9 +211,9 @@ public class MjonMsgCampainDataController {
|
||||
|
||||
// 외부에서 선거발송 페이지로 들어오는걸 막음
|
||||
// 20250102 이호영
|
||||
/*if (!"localhost".equals(hostName) && !"119.193.215.98".equals(hostName)) {
|
||||
if (!"localhost".equals(hostName) && !"119.193.215.98".equals(hostName)) {
|
||||
return "redirect:/web/mjon/msgdata/selectMsgDataView.do";
|
||||
}*/
|
||||
}
|
||||
|
||||
String categoryType = cateCode.getCateType();
|
||||
|
||||
|
||||
@ -200,17 +200,9 @@ public class MjonMsgCampainTWDataController {
|
||||
|
||||
// 외부에서 선거발송 페이지로 들어오는걸 막음
|
||||
// 20250102 이호영
|
||||
System.out.println("hostName :: "+ hostName);
|
||||
System.out.println("hostName :: "+ hostName);
|
||||
System.out.println("hostName :: "+ hostName);
|
||||
System.out.println("hhhhhhhh hostName :: "+ hostName);
|
||||
System.out.println("hostName :: "+ hostName);
|
||||
System.out.println("hostName :: "+ hostName);
|
||||
// if (!"localhost".equals(hostName)
|
||||
// && !"119.193.215.98".equals(hostName))
|
||||
// {
|
||||
// return "redirect:/web/mjon/msgdata/selectMsgDataView.do";
|
||||
// }
|
||||
if (!"localhost".equals(hostName)) {
|
||||
return "redirect:/web/mjon/msgdata/selectMsgDataView.do";
|
||||
}
|
||||
|
||||
String categoryType = cateCode.getCateType();
|
||||
|
||||
|
||||
@ -190,7 +190,7 @@ public interface MjonMsgDataService {
|
||||
|
||||
public MjonMsgReturnVO sendSysMsgData(MjonMsgVO mjonMsgVO, HttpServletRequest request) throws Exception;
|
||||
|
||||
public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -403,10 +403,6 @@ public class MjonMsgDataDAO extends EgovAbstractDAO {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception{
|
||||
return (Boolean) select("mjonMsgDataDAO.selectSysMsgTodaySendYn",sendLogVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 다량 데이터를 Batch 처리로 MJ_MSG_DATA 테이블에 INSERT
|
||||
@ -467,23 +463,6 @@ public class MjonMsgDataDAO extends EgovAbstractDAO {
|
||||
}
|
||||
|
||||
|
||||
//대체문자 대기 목록 조회
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<MjonMsgVO> selectBizResendLogList()throws Exception{
|
||||
|
||||
return (List<MjonMsgVO>) list("mjonMsgDataDAO.selectBizResendLogList");
|
||||
}
|
||||
//대체문자 결과 반영
|
||||
public int updateResendResult(MjonMsgVO mjonMsgVO)throws Exception{
|
||||
|
||||
return update("mjonMsgDataDAO.updateResendResult", mjonMsgVO);
|
||||
}
|
||||
//대체문자 로그 삭제
|
||||
public int deleteBizResendLog(MjonMsgVO mjonMsgVO)throws Exception{
|
||||
|
||||
return delete("mjonMsgDataDAO.deleteBizResendLog", mjonMsgVO);
|
||||
}
|
||||
|
||||
|
||||
public Timestamp convertToTimestamp(String reqDate) {
|
||||
try {
|
||||
|
||||
@ -3946,39 +3946,26 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
@Override
|
||||
public StatusResponse sendMsgData_advc(MjonMsgVO mjonMsgVO, HttpServletRequest request) throws Exception {
|
||||
|
||||
// log.info("mjonMsgVO [{}]", mjonMsgVO.getMjonMsgSendVOList().get(0).getPhone());
|
||||
log.info("mjonMsgVO [{}]", mjonMsgVO.getMjonMsgSendVOList().get(0).getPhone());
|
||||
log.info(" :: sendMsgData_advc :: ");
|
||||
log.info(" + mjonMsgVO.toString() :: [{}]", mjonMsgVO.toString());
|
||||
|
||||
StatusResponse statusResponse = new StatusResponse();
|
||||
|
||||
Map<String, Object> returnMap = new HashMap<>();
|
||||
Map<String, Object> apiReturnMap = new HashMap<>();
|
||||
|
||||
String userId = "";
|
||||
if("A".equals(mjonMsgVO.getSendKind()))
|
||||
{
|
||||
userId = mjonMsgVO.getMberId();
|
||||
}else {
|
||||
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()
|
||||
? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser()
|
||||
: null;
|
||||
userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if (userId.equals("")) {
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용이 가능합니다.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mjonMsgVO.setUserId(userId);
|
||||
|
||||
// 발신번호가 등록된 유효한 번호인지 확인
|
||||
int sendCallFromCnt = mjonMsgDAO.selectCallFromNumberChk(mjonMsgVO);
|
||||
if (sendCallFromCnt < 1) {
|
||||
// return new StatusResponse(HttpStatus.BAD_REQUEST, "등록된 발신번호를 찾을 수 없습니다.");
|
||||
return StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "등록된 발신번호를 찾을 수 없습니다.", "STAT_1010");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "등록된 발신번호를 찾을 수 없습니다.");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3988,10 +3975,8 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
if (!mberSttus) {
|
||||
request.getSession().invalidate();
|
||||
// UNAUTHORIZED : 인증되지 않은 사용자가 접근하려고 할 때
|
||||
// return new StatusResponse(HttpStatus.UNAUTHORIZED,
|
||||
// "현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 문자를 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.");
|
||||
return StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 문자를 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다."
|
||||
, "STAT_1070");
|
||||
return new StatusResponse(HttpStatus.UNAUTHORIZED,
|
||||
"현재 고객님께서는 문자온 서비스 이용이 정지된 상태로 문자를 발송하실 수 없습니다. 이용정지 해제를 원하시면 고객센터로 연락주시기 바랍니다.");
|
||||
}
|
||||
|
||||
String smsTxt = mjonMsgVO.getSmsTxtArea();
|
||||
@ -4005,9 +3990,9 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
|
||||
log.debug(" :: smsTxt :: [{}]", smsTxt);
|
||||
|
||||
StatusResponse statusResponse = new StatusResponse();
|
||||
|
||||
// 화면에서 저장한 이미지 가져오기
|
||||
// API는 이미지가 없어서 해당 없음
|
||||
mjonMsgVO = setImagesSetting(mjonMsgVO, statusResponse);
|
||||
|
||||
if (mjonMsgVO == null) {
|
||||
@ -4029,10 +4014,9 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
int deletedCount = initialSize - finalSize;
|
||||
// 수신거부 목록
|
||||
returnMap.put("resultBlockSts", deletedCount);
|
||||
apiReturnMap.put("resultBlockSts", deletedCount);
|
||||
|
||||
if (mjonMsgSendVOList.size() < 1) {
|
||||
return StatusResponse.statusResponseSet(statusResponse, HttpStatus.BAD_REQUEST, "수신거부와 매칭되는 번호 제거 후 \n발송 가능한 수신목록이 존재하지 않습니다.", "STAT_1021");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "수신거부와 매칭되는 번호 제거 후 \n발송 가능한 수신목록이 존재하지 않습니다.");
|
||||
}
|
||||
|
||||
// 전용 전송사 코드 및 대표 전송사 조회
|
||||
@ -4139,7 +4123,7 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
* */
|
||||
if (!isCashSufficient(mjonMsgVO, mjonMsgSendVOList)) {
|
||||
log.error("Insufficient balance for message sending.");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다.", "STAT_1060");
|
||||
return new StatusResponse(HttpStatus.BAD_REQUEST, "문자 발송에 필요한 보유 잔액이 부족 합니다.");
|
||||
}
|
||||
|
||||
System.out.println("==================== insert 시작 ====================");
|
||||
@ -4154,8 +4138,6 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
// instTotalCnt : 화면에서 보여줄 총 발송건수
|
||||
int instTotalCnt = 0;
|
||||
// Step 2: 그룹화 된 데이터를 그룹별로 insert 처리
|
||||
String apiMsgGroupId = "";
|
||||
String apiMsgType = "";
|
||||
for (Map.Entry<String, List<MjonMsgSendVO>> entry : priceGroupedMessages.entrySet()) {
|
||||
List<MjonMsgSendVO> groupedMsgList = entry.getValue(); // 해당 가격의 메시지 리스트
|
||||
|
||||
@ -4163,15 +4145,6 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
String nextMsgGroupId = idgenMjonMsgGroupId.getNextStringId();
|
||||
groupedMsgList.forEach(t -> t.setMsgGroupId(nextMsgGroupId));
|
||||
|
||||
// api 전달 값
|
||||
apiMsgGroupId = StringUtils.isNotEmpty(apiMsgGroupId)
|
||||
? apiMsgGroupId + "," + nextMsgGroupId
|
||||
: nextMsgGroupId;
|
||||
|
||||
apiMsgType = StringUtils.isNotEmpty(apiMsgType)
|
||||
? apiMsgType + "," + mjonMsgSendVOList.get(0).getMsgType()
|
||||
: mjonMsgSendVOList.get(0).getMsgType();
|
||||
|
||||
// 발송 데이터 삽입
|
||||
int instCnt = this.insertMsgData_advc(groupedMsgList);
|
||||
|
||||
@ -4203,37 +4176,16 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
|
||||
log.debug("가격 [{}]의 총 갯수: [{}]", entry.getKey(), groupedMsgList.size());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 그룹 ID
|
||||
apiReturnMap.put("msgGroupId", apiMsgGroupId);
|
||||
// 메세지 타입
|
||||
apiReturnMap.put("msgType", apiMsgType);
|
||||
// 총 발송 건수
|
||||
returnMap.put("resultSts", instTotalCnt);
|
||||
apiReturnMap.put("resultSts", instTotalCnt);
|
||||
|
||||
|
||||
// db insert 성능 개선중 하나에 방법
|
||||
// 분할 최대건수가 되면 디비에 입력하기
|
||||
// 여러시도 했지만 일단 보류
|
||||
// 무시해도 됨
|
||||
// int instCnt = mjonMsgDataDAO.insertMsgDataInfo_advc(mjonMsgSendVOList);
|
||||
// int instCnt = mjonMsgDataDAO.insertMsgDataInfo_jdbc_advc(mjonMsgSendVOList);
|
||||
|
||||
|
||||
//50건이상 문자발송 시 안내메시지 전송
|
||||
try {
|
||||
if(
|
||||
"p".equals(userInfo.getDept()) // 개인회원일 경우에만 발송
|
||||
) {
|
||||
mjonCommon.sendMessagesIfOverFifty(instTotalCnt, mjonMsgVO.getCallFrom());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("sendMessagesIfOverFifty method exception.");
|
||||
}
|
||||
// 총 발송 건수
|
||||
returnMap.put("resultSts", instTotalCnt);
|
||||
|
||||
// TEST발송 시 발송 후 캐시가 있어야함.
|
||||
returnMap.put("afterCash", priceAndPoint.getBefCash(userId));
|
||||
@ -4253,10 +4205,6 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
|
||||
statusResponse.setStatus(HttpStatus.OK);
|
||||
statusResponse.setObject(returnMap);
|
||||
|
||||
apiReturnMap.put("result", HttpStatus.OK);
|
||||
apiReturnMap.put("message", "문자 전송이 완료되었습니다.");
|
||||
statusResponse.setApiReturn(apiReturnMap);
|
||||
return statusResponse;
|
||||
|
||||
}
|
||||
@ -4404,9 +4352,7 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
int fileCount = 0;
|
||||
// 장문 메시지일 경우 + 그림 이미지가 첨부된 경우
|
||||
//
|
||||
log.info(" + mjonMsgVO.getMsgType() :: [{}]", mjonMsgVO.getMsgType());
|
||||
log.info(" + mjonMsgVO.getImgFilePathAdvc() :: [{}]", mjonMsgVO.getImgFilePathAdvc());
|
||||
if ("6".equals(mjonMsgVO.getMsgType()) && mjonMsgVO.getImgFilePathAdvc() != null
|
||||
if (mjonMsgVO.getMsgType().equals("6") && mjonMsgVO.getImgFilePathAdvc() != null
|
||||
&& mjonMsgVO.getImgFileIdAdvc() != null) {
|
||||
|
||||
// 그림 이미지가 첨부된 경우
|
||||
@ -5202,9 +5148,4 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
|
||||
return returnVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean selectSysMsgTodaySendYn(SendLogVO sendLogVO) throws Exception{
|
||||
return mjonMsgDataDAO.selectSysMsgTodaySendYn(sendLogVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6543,4 +6543,5 @@ public class MjonMsgDataController {
|
||||
|
||||
return "web/msgdata/MsgSentListAjax";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
package itn.let.mjo.msgsent.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import itn.let.cmm.vo.FileInfoVO;
|
||||
import itn.let.uss.umt.service.UserDefaultVO;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class MjonMsgDetailSentDTO extends UserDefaultVO{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
private String userId;
|
||||
private String callTo;
|
||||
private String statusTxt;
|
||||
|
||||
|
||||
}
|
||||
@ -65,7 +65,7 @@ public interface MjonMsgSentService {
|
||||
|
||||
public Map<String, Object> selectAllMsgSentDetailView(MjonMsgDetailSentVO mjonMsgDetailSentVO) throws Exception;
|
||||
|
||||
public List<MjonMsgDetailSentDTO> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO);
|
||||
public List<MjonMsgDetailSentVO> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO);
|
||||
|
||||
public void msgSentExcelDownLoad(MjonMsgSentVO mjonMsgSentVO, HttpServletResponse response) throws IOException, Exception;
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@ import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
|
||||
import itn.let.fax.addr.service.FaxAddrGroupVO;
|
||||
import itn.let.mjo.addr.service.AddrGroupVO;
|
||||
import itn.let.mjo.block.service.MjonBlockVO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgDetailSentDTO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgDetailSentVO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgSWFDTO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgSentVO;
|
||||
@ -183,9 +182,9 @@ public class MjonMsgSentDAO extends EgovAbstractDAO {
|
||||
return (MjonMsgDetailSentVO) select("MjonMsgSentDAO.selectAllMsgSentDetailView", mjonMsgDetailSentVO);
|
||||
}
|
||||
|
||||
public List<MjonMsgDetailSentDTO> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO) {
|
||||
public List<MjonMsgDetailSentVO> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO) {
|
||||
|
||||
return (List<MjonMsgDetailSentDTO>) list("MjonMsgSentDAO.findByMsgDetailListAjax", mjonMsgDetailSentVO);
|
||||
return (List<MjonMsgDetailSentVO>) list("MjonMsgSentDAO.findByMsgDetailListAjax", mjonMsgDetailSentVO);
|
||||
}
|
||||
|
||||
public List<String> findByReqDateWhereMsgGroupId(String msgGroupId) {
|
||||
|
||||
@ -34,13 +34,11 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import itn.com.cmm.util.StringUtil;
|
||||
import itn.com.cmm.util.StringUtil2;
|
||||
import itn.let.cmm.vo.FileInfoVO;
|
||||
import itn.let.fax.addr.service.FaxAddrGroupVO;
|
||||
import itn.let.mjo.addr.service.AddrGroupVO;
|
||||
import itn.let.mjo.block.service.MjonBlockVO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgDetailSentDTO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgDetailSentVO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgSWFDTO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgSentService;
|
||||
@ -127,11 +125,6 @@ public class MjonMsgSentServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
|
||||
//수신번호 검색 시 번호 포멧 통일
|
||||
if("4".equals(mjonMsgSentVO.getSearchCondition()) && StringUtil.isNotEmpty(mjonMsgSentVO.getSearchKeyword())) {
|
||||
mjonMsgSentVO.setSearchKeyword(mjonMsgSentVO.getSearchKeyword().trim().replace("-", ""));
|
||||
}
|
||||
|
||||
// 목록
|
||||
List<MjonMsgSentVO> resultList = mjonMsgSentDAO.selectAllMsgSentList_advc(mjonMsgSentVO);
|
||||
|
||||
@ -481,9 +474,9 @@ public class MjonMsgSentServiceImpl extends EgovAbstractServiceImpl implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MjonMsgDetailSentDTO> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO) {
|
||||
public List<MjonMsgDetailSentVO> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO) {
|
||||
|
||||
List<MjonMsgDetailSentDTO> list = mjonMsgSentDAO.findByMsgDetailListAjax(mjonMsgDetailSentVO);
|
||||
List<MjonMsgDetailSentVO> list = mjonMsgSentDAO.findByMsgDetailListAjax(mjonMsgDetailSentVO);
|
||||
list.stream().forEach(t->{
|
||||
t.setCallTo(StringUtil2.formatPhone(t.getCallTo()));
|
||||
});
|
||||
@ -644,7 +637,7 @@ public class MjonMsgSentServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
// log.info("엑셀에 넣을 데이터: [{}]", data[i][1]);
|
||||
|
||||
data[i][2] = "A".equals(vo.getSendKind()) ? "API" : "WEB";
|
||||
data[i][2] = "H".equals(vo.getSendKind()) ? "WEB" : "API";
|
||||
|
||||
String msgType="단문";
|
||||
if ("6".equals(vo.getMsgType())) {
|
||||
@ -848,8 +841,8 @@ public class MjonMsgSentServiceImpl extends EgovAbstractServiceImpl implements
|
||||
&& result.getDiffMin() < -5 // 예약 시간이 5분 이상인 것들만
|
||||
) {
|
||||
returnCode = "03"; // 예약대기 코드 ( 예약취소 버튼 노출 )
|
||||
} else if (Integer.parseInt(result.getMsgGroupCnt()) == Integer.parseInt(result.getResultSValue()) + Integer.parseInt(result.getResultFValue())
|
||||
) {
|
||||
} else if (result.getMsgGroupCnt().equals(result.getResultSValue())
|
||||
|| result.getMsgGroupCnt().equals(result.getResultFValue())) {
|
||||
returnCode = "02"; // 완료 코드
|
||||
} else {
|
||||
returnCode = "01"; // 진행중 코드
|
||||
|
||||
@ -50,7 +50,6 @@ import itn.let.mjo.addr.service.AddrService;
|
||||
import itn.let.mjo.addr.service.AddrVO;
|
||||
import itn.let.mjo.apikey.service.ApiKeyMngService;
|
||||
import itn.let.mjo.apikey.service.ApiKeyVO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgDetailSentDTO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgDetailSentVO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgSentCntVO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgSentService;
|
||||
@ -192,17 +191,7 @@ private static final Logger logger = LoggerFactory.getLogger(MjonMsgSentControll
|
||||
public ResponseEntity<StatusResponse> findByMsgDetailListAjax(MjonMsgDetailSentVO mjonMsgDetailSentVO) throws Exception {
|
||||
|
||||
|
||||
List<MjonMsgDetailSentDTO> resultList = new ArrayList<>();
|
||||
try {
|
||||
|
||||
resultList = mjonMsgSentService.findByMsgDetailListAjax(mjonMsgDetailSentVO);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// TODO: handle exception
|
||||
}
|
||||
log.info("resultList :: [{}]", resultList.size());
|
||||
// resultList = resultList.subList(0, 275000);
|
||||
// log.info("resultList :: [{}]", resultList.size());
|
||||
List<MjonMsgDetailSentVO> resultList = mjonMsgSentService.findByMsgDetailListAjax(mjonMsgDetailSentVO);
|
||||
|
||||
|
||||
return ResponseEntity.ok().body(new StatusResponse(HttpStatus.OK, "", resultList));
|
||||
|
||||
@ -18,10 +18,10 @@ public class KmcVO extends ComDefaultVO{
|
||||
private String gender = ""; // 성별
|
||||
private String nation = ""; // 내국인
|
||||
private String name = ""; // 성명
|
||||
// private String MName = ""; // 미성년자 성명
|
||||
// private String MBirthDay = ""; // 미성년자 생년월일
|
||||
// private String MGender = ""; // 미성년자 성별
|
||||
// private String MNation = ""; // 미성년자 내외국인
|
||||
private String MName = ""; // 미성년자 성명
|
||||
private String MBirthDay = ""; // 미성년자 생년월일
|
||||
private String MGender = ""; // 미성년자 성별
|
||||
private String MNation = ""; // 미성년자 내외국인
|
||||
private String result = ""; // 결과값
|
||||
|
||||
private String certMet = ""; // 인증방법
|
||||
@ -41,11 +41,6 @@ public class KmcVO extends ComDefaultVO{
|
||||
private String idx = ""; //본인인증 로그 idx
|
||||
private String dnChk = ""; //본인명의 DN 체크
|
||||
|
||||
private String reserve1 = "";
|
||||
private String reserve2 = "";
|
||||
private String reserve3 = "";
|
||||
private String reserve4 = "";
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
@ -182,6 +177,30 @@ public class KmcVO extends ComDefaultVO{
|
||||
public void setCertNum(String certNum) {
|
||||
this.certNum = certNum;
|
||||
}
|
||||
public String getMName() {
|
||||
return MName;
|
||||
}
|
||||
public void setMName(String mName) {
|
||||
MName = mName;
|
||||
}
|
||||
public String getMBirthDay() {
|
||||
return MBirthDay;
|
||||
}
|
||||
public void setMBirthDay(String mBirthDay) {
|
||||
MBirthDay = mBirthDay;
|
||||
}
|
||||
public String getMGender() {
|
||||
return MGender;
|
||||
}
|
||||
public void setMGender(String mGender) {
|
||||
MGender = mGender;
|
||||
}
|
||||
public String getMNation() {
|
||||
return MNation;
|
||||
}
|
||||
public void setMNation(String mNation) {
|
||||
MNation = mNation;
|
||||
}
|
||||
public String getRecCert() {
|
||||
return recCert;
|
||||
}
|
||||
@ -206,30 +225,7 @@ public class KmcVO extends ComDefaultVO{
|
||||
public void setCertType(String certType) {
|
||||
this.certType = certType;
|
||||
}
|
||||
public String getReserve1() {
|
||||
return reserve1;
|
||||
}
|
||||
public void setReserve1(String reserve1) {
|
||||
this.reserve1 = reserve1;
|
||||
}
|
||||
public String getReserve2() {
|
||||
return reserve2;
|
||||
}
|
||||
public void setReserve2(String reserve2) {
|
||||
this.reserve2 = reserve2;
|
||||
}
|
||||
public String getReserve3() {
|
||||
return reserve3;
|
||||
}
|
||||
public void setReserve3(String reserve3) {
|
||||
this.reserve3 = reserve3;
|
||||
}
|
||||
public String getReserve4() {
|
||||
return reserve4;
|
||||
}
|
||||
public void setReserve4(String reserve4) {
|
||||
this.reserve4 = reserve4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
package itn.let.mjo.pay.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
|
||||
public interface MjonPayService {
|
||||
|
||||
List<MjonPayVO> selectPayList(MjonPayVO mjonPayVO) throws Exception;
|
||||
@ -143,11 +140,4 @@ public interface MjonPayService {
|
||||
//누적 납부금액 조회 (후불회원이 사용금액을 실 납부한 금액 합산 - 미납 금액 제외한 총 합산 금액)
|
||||
public String selectTotSumPaymentAfterPay(String userId) throws Exception;
|
||||
|
||||
Map<String, Object> payUserSWList(MjonPayVO mjonPayVO) throws Exception;
|
||||
|
||||
Map<String, Object> payUserSWListAjax(MjonMsgVO mjonMsgVO) throws Exception;
|
||||
|
||||
//거래명세서 상세 조회
|
||||
MjonPayVO selectPayDetail(MjonPayVO mjonPayVO) throws Exception;
|
||||
|
||||
}
|
||||
|
||||
@ -236,16 +236,8 @@ public class MjonPayVO extends ComDefaultVO{
|
||||
|
||||
private int remainPoint;
|
||||
|
||||
private String userData;
|
||||
|
||||
|
||||
private String totChgPay; // 간편결제분류
|
||||
|
||||
// 거래명세서 내용
|
||||
private String bizNo; // 사업자등록번호
|
||||
private String managerNm; // 담당자명
|
||||
private String prePaymentYn; // 선불결제여부 N:후불제고객
|
||||
private String dept; // 회원종류 p:개인 c:기업
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.List;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
|
||||
import itn.let.kakao.kakaoComm.BizKakaoPriceVO;
|
||||
import itn.let.mjo.pay.service.MjonPayVO;
|
||||
import itn.let.mjo.pay.service.MjonVaMsgLogVO;
|
||||
import itn.let.mjo.pay.service.RefundVO;
|
||||
@ -47,10 +46,6 @@ public class MjonPayDAO extends EgovAbstractDAO {
|
||||
return (MjonPayVO)select("mjonPayDAO.selectCashVO", mjonPayVO);
|
||||
}
|
||||
|
||||
public BizKakaoPriceVO selectBizKakaoPrice(String msgGroupId) throws Exception{
|
||||
return (BizKakaoPriceVO)select("mjonPayDAO.selectBizKakaoPrice", msgGroupId);
|
||||
}
|
||||
|
||||
public void insertCash(MjonPayVO mjonPayVO) throws Exception{
|
||||
|
||||
try {
|
||||
@ -359,7 +354,4 @@ public class MjonPayDAO extends EgovAbstractDAO {
|
||||
|
||||
}
|
||||
|
||||
public MjonPayVO selectPayDetail(MjonPayVO mjonPayVO) throws Exception{
|
||||
return (MjonPayVO)select("mjonPayDAO.selectPayDetail", mjonPayVO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,16 +7,11 @@ import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.security.MessageDigest;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -30,15 +25,11 @@ 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.cmm.util.DateUtils;
|
||||
import itn.com.cmm.util.MJUtil;
|
||||
import itn.com.cmm.util.PayUtils;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.mjo.event.service.MjonEventVO;
|
||||
import itn.let.mjo.event.service.impl.MjonEventDAO;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msgcampain.service.MjonCandidateVO;
|
||||
import itn.let.mjo.msgcampain.service.impl.MjonCandidateDAO;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgDataService;
|
||||
import itn.let.mjo.msgdata.service.impl.MjonMsgDataDAO;
|
||||
import itn.let.mjo.pay.service.MjonPayService;
|
||||
@ -103,10 +94,6 @@ public class MjonPayServiceImpl extends EgovAbstractServiceImpl implements MjonP
|
||||
@Resource(name = "mberGrdService")
|
||||
MberGrdService mberGrdService;
|
||||
|
||||
@Resource(name="mjonCandidateDAO")
|
||||
private MjonCandidateDAO mjonCandidateDAO;
|
||||
|
||||
|
||||
@Override
|
||||
public List<MjonPayVO> selectPayList(MjonPayVO mjonPayVO) throws Exception {
|
||||
return mjonPayDAO.selectPayList(mjonPayVO);
|
||||
@ -2852,144 +2839,6 @@ public class MjonPayServiceImpl extends EgovAbstractServiceImpl implements MjonP
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> payUserSWList(MjonPayVO mjonPayVO) throws Exception{
|
||||
|
||||
|
||||
String userId = mjonPayVO.getUserId();
|
||||
|
||||
// 총 사용금액
|
||||
List<MjonPayVO> usedCashTotList = mjonPayDAO.selectUsedCashWithKakaoTotCnt(mjonPayVO);
|
||||
|
||||
// 사용가능한 금액
|
||||
// mberManageVO.prePaymentYn 선불 후불 회원 구분으로 인해 select함
|
||||
MberManageVO mberManageVO = mjonMsgDataDAO.selectMberManageInfo(userId);
|
||||
// 선거 후보자 정보 조회
|
||||
MjonCandidateVO mjonCandidateVO = new MjonCandidateVO();
|
||||
if("p".equals(mberManageVO.getDept())) { //개인회원 선거 후보자 정보 불러오기
|
||||
mjonCandidateVO = mjonCandidateDAO.selectCandidateDataInfo(userId);
|
||||
if(mjonCandidateVO != null) {
|
||||
mjonCandidateVO.setRegidentNo1(egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo1()));
|
||||
mjonCandidateVO.setRegidentNo2(egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo2()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 후불제 회원 관련 사용 요금 내역 정보 조회하기
|
||||
* 20231228 우영두 추가
|
||||
* 누적사용금액, 누적 납부금액, 당월 납부 예상금액 정보 조회
|
||||
*
|
||||
* */
|
||||
//누적 사용금액 조회 (캐시 테이블에서 현재까지 사용된 금액 합산 - 캐시 테이블에서 "-"로 사용된 금액만 합산)
|
||||
String totSumCashAfterPay = mjonPayDAO.selectTotalSumCashForAfterPay(userId);
|
||||
|
||||
//누적 사용 포인트 조회 (포인트 테이블에서 현재까지 사용된 포인트 합산 - 회원 포인트 정보 업데이트시 사용되는 쿼리 이용)
|
||||
String totSumPointAfterPay = mjonPayDAO.selectTotalSumPointForAfterPay(userId);
|
||||
|
||||
//누적 납부금액 조회 (후불회원이 사용금액을 실 납부한 금액 합산 - 미납 금액 제외한 총 합산 금액)
|
||||
String totSumPaymentAfterPay = mjonPayDAO.selectTotSumPaymentAfterPay(userId);
|
||||
|
||||
//누적 납부 포인트 조회 ( 누적 납부금액 합산에 대한 2% 포인트 정보 계산)
|
||||
float p_i_re_point = 0;
|
||||
JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo();
|
||||
if (sysJoinSetVO != null) {
|
||||
p_i_re_point = sysJoinSetVO.getPointPer();
|
||||
}
|
||||
int paymentPointAfterPay = Math.round((Float.parseFloat(totSumPaymentAfterPay) * p_i_re_point / 100));
|
||||
|
||||
//당월 납부 예상금액 (누적 사용금액 합산 - 누적 납부금액 합산 정보 계산)
|
||||
float unPaymentAfterPay = Float.parseFloat(totSumCashAfterPay) - Float.parseFloat(totSumPaymentAfterPay);
|
||||
|
||||
//당월 납부 예상 포인트 (당월 납부 예상 금액에 대한 2% 포인트 정보 계산)
|
||||
int unPaymentPointAfterPay = Math.round((unPaymentAfterPay * p_i_re_point / 100));
|
||||
|
||||
/*
|
||||
* 2024.02.06 후불제 회원 중 협의단가를 사용하는 회원은 포인트 적립이 되지 않아야함.
|
||||
* 후불제 협의 단가 여부 체크
|
||||
* 모든 협의 단가 금액을 합산하여 0보다 크면 협의단가 있음.
|
||||
* */
|
||||
float shortPrice = mberManageVO.getShortPrice();
|
||||
float longPrice = mberManageVO.getLongPrice();
|
||||
float picturePrice = mberManageVO.getPicturePrice() + mberManageVO.getPicture2Price() + mberManageVO.getPicture3Price();
|
||||
float kakaoAtPrice = mberManageVO.getKakaoAtPrice();
|
||||
float kakaoFtPrice = mberManageVO.getKakaoFtPrice();
|
||||
float totPrice = shortPrice + longPrice + picturePrice + kakaoAtPrice + kakaoFtPrice;
|
||||
String negoPriceYn = "N";
|
||||
|
||||
if(totPrice > 0) {
|
||||
negoPriceYn = "Y";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Map<String, Object> returnData = new HashMap<>();
|
||||
|
||||
|
||||
returnData.put("usedCashTotList", usedCashTotList);
|
||||
returnData.put("mberManageVO", mberManageVO);
|
||||
returnData.put("mjonCandidateVO", mjonCandidateVO);
|
||||
returnData.put("totSumCashAfterPay", totSumCashAfterPay);
|
||||
returnData.put("totSumPointAfterPay", totSumPointAfterPay);
|
||||
returnData.put("totSumPaymentAfterPay", totSumPaymentAfterPay);
|
||||
returnData.put("sumPaymentPointAfterPay", paymentPointAfterPay);
|
||||
returnData.put("unPaymentAfterPay", unPaymentAfterPay);
|
||||
returnData.put("unPaymentPointAfterPay", unPaymentPointAfterPay);
|
||||
returnData.put("negoPriceYn", negoPriceYn);
|
||||
// 초기 날짜 셋팅
|
||||
returnData.put("startDate", DateUtils.getDateMonthsAgo(1));
|
||||
returnData.put("endDate", DateUtils.getCurrentDate());
|
||||
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
return returnData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> payUserSWListAjax(MjonMsgVO mjonMsgVO) throws Exception{
|
||||
|
||||
if("".equals(mjonMsgVO.getSearchSortCnd())){ //최초조회시 최신것 조회List
|
||||
mjonMsgVO.setSearchSortCnd("regDate");
|
||||
mjonMsgVO.setSearchSortOrd("desc");
|
||||
}
|
||||
|
||||
Map<String, Object> returnData = new HashMap<>();
|
||||
|
||||
// 검색 데이터가 없거나
|
||||
// 시작일자가 종료일자보다 이후이거나
|
||||
// 총 기간이 365일이 넘으면 현재일부터 365일 전 날짜를 넣어서 검색
|
||||
if(!DateUtils.dateChkAndValueChk(mjonMsgVO.getStartDate(),mjonMsgVO.getEndDate(), 12 )) {
|
||||
|
||||
mjonMsgVO.setStartDate(DateUtils.getDateMonthsAgo(12));
|
||||
mjonMsgVO.setEndDate(DateUtils.getCurrentDate());
|
||||
|
||||
};
|
||||
|
||||
|
||||
List<MjonMsgVO> payUserSWList = mjonMsgDataDAO.selectPayUserSWList(mjonMsgVO);
|
||||
returnData.put("payUserSWList", payUserSWList);
|
||||
returnData.put("totCnt", payUserSWList.size()> 0 ? payUserSWList.get(0).getTotCnt() : 0);
|
||||
returnData.put("totSuccSendPrice", payUserSWList.size() > 0 ? PayUtils.getTrimToFirstDecimal(payUserSWList.get(0).getTotSuccSendPrice()) : 0);
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MjonPayVO selectPayDetail(MjonPayVO mjonPayVO) throws Exception {
|
||||
|
||||
MjonPayVO result = mjonPayDAO.selectPayDetail(mjonPayVO);
|
||||
/* 후불제 고객의 사용기한 조회(결제일의 전달 1일 ~ 말일) */
|
||||
if("N".equals(result.getPrePaymentYn())) {
|
||||
String regDateStr = result.getRegDate();
|
||||
LocalDateTime regDate = Timestamp.valueOf(regDateStr).toLocalDateTime();
|
||||
|
||||
LocalDate lastMonth = regDate.toLocalDate().withDayOfMonth(1).minusMonths(1);
|
||||
LocalDate startDate = lastMonth.withDayOfMonth(1);
|
||||
LocalDate endDate = lastMonth.withDayOfMonth(lastMonth.lengthOfMonth());
|
||||
|
||||
result.setStartDate(startDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
result.setEndDate(endDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +91,6 @@ import itn.let.sym.grd.service.MberGrdVO;
|
||||
import itn.let.sym.site.service.EgovSiteManagerService;
|
||||
import itn.let.sym.site.service.JoinSettingVO;
|
||||
import itn.let.uat.uia.service.AuthCertVO;
|
||||
import itn.let.uat.uia.web.KmcCertChecker;
|
||||
import itn.let.uss.umt.service.EgovMberManageService;
|
||||
import itn.let.uss.umt.service.EgovUserManageService;
|
||||
import itn.let.uss.umt.service.MberManageVO;
|
||||
@ -168,9 +167,6 @@ public class MjonPayController {
|
||||
@Resource(name = "mberGrdService")
|
||||
MberGrdService mberGrdService;
|
||||
|
||||
@Resource(name = "KmcCertChecker")
|
||||
KmcCertChecker kmcCertChecker;
|
||||
|
||||
//배열 정의{"컬럼순차번호, 컬럼이름, 컬럼내용, 컬럼이름에 붙여야할 내용(엑셀코드양식다운로드시 필요)"}
|
||||
private String[][] sendPayExcelValue ={
|
||||
{"0" ,"번호" , "1" , "" },
|
||||
@ -934,7 +930,7 @@ public class MjonPayController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원가입 본인인증
|
||||
* 나이스페이(PG사 전송화면)
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
@ -945,10 +941,270 @@ public class MjonPayController {
|
||||
ModelMap model , @RequestParam Map<String, Object> commandMap,
|
||||
@ModelAttribute("searchVO") KmcVO kmcVO) throws Exception {
|
||||
|
||||
//kmc 본인인증 결과처리
|
||||
kmcVO = kmcCertChecker.authCertResult(request, response, model);
|
||||
//kmc 본인인증 로그 처리
|
||||
AuthCertVO certVO = kmcCertChecker.insertCertLog(kmcVO, "KMC_회원가입 인증");
|
||||
//크롬 SameSite정책 방지 - 도메인이 다른 타사로 이동 시 크롬 정책에 의해 세션 유실이 일어나는 경우가 있는데, 이를 방지하기 위해 samesite 보안을 none처리
|
||||
response.setHeader("Set-Cookie", "mberSession=mberSession; Secure; SameSite=None");
|
||||
|
||||
System.out.println("++++++++++++ 세션체크 ::: "+ session.getAttribute("mberSession"));
|
||||
|
||||
String errMessage = ""; //에러메세지
|
||||
|
||||
String rec_cert = ""; // 결과값(암호화)
|
||||
String certNum = ""; // certNum
|
||||
|
||||
rec_cert = request.getParameter("rec_cert").trim();
|
||||
certNum = request.getParameter("certNum").trim();
|
||||
|
||||
kmcVO.setRecCert(rec_cert);
|
||||
kmcVO.setCertNum(certNum);
|
||||
// 파라미터 유효성 검증
|
||||
if( rec_cert.length() == 0 || certNum.length() == 0 ){
|
||||
errMessage = "비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
|
||||
// 변수선언 --------------------------------------------------------------------------------------------------------
|
||||
String k_certNum = ""; // 파라미터로 수신한 요청번호
|
||||
k_certNum = certNum;
|
||||
String date = ""; // 요청일시
|
||||
String CI = ""; // 연계정보(CI)
|
||||
String DI = ""; // 중복가입확인정보(DI)
|
||||
String phoneNo = ""; // 휴대폰번호
|
||||
String phoneCorp = ""; // 이동통신사
|
||||
String birthDay = ""; // 생년월일
|
||||
String gender = ""; // 성별
|
||||
String nation = ""; // 내국인
|
||||
String name = ""; // 성명
|
||||
String M_name = ""; // 미성년자 성명
|
||||
String M_birthDay = ""; // 미성년자 생년월일
|
||||
String M_Gender = ""; // 미성년자 성별
|
||||
String M_nation = ""; // 미성년자 내외국인
|
||||
String result = ""; // 결과값
|
||||
|
||||
String certMet = ""; // 인증방법
|
||||
String ip = ""; // ip주소
|
||||
String plusInfo = "";
|
||||
|
||||
String encPara = "";
|
||||
String encMsg1 = "";
|
||||
String encMsg2 = "";
|
||||
String msgChk = "";
|
||||
|
||||
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||
|
||||
//02. 1차 복호화
|
||||
//수신된 certNum를 이용하여 복호화
|
||||
rec_cert = seed.getDec(rec_cert, k_certNum);
|
||||
|
||||
//03. 1차 파싱
|
||||
int inf1 = rec_cert.indexOf("/",0);
|
||||
int inf2 = rec_cert.indexOf("/",inf1+1);
|
||||
|
||||
encPara = rec_cert.substring(0,inf1); //암호화된 통합 파라미터
|
||||
encMsg1 = rec_cert.substring(inf1+1,inf2); //암호화된 통합 파라미터의 Hash값
|
||||
|
||||
//04. 위변조 검증
|
||||
encMsg2 = seed.getMsg(encPara);
|
||||
kmcVO.setEncMsg2(encMsg2);
|
||||
if(encMsg2.equals(encMsg1)){
|
||||
msgChk="Y";
|
||||
}
|
||||
|
||||
if(!"Y".equals(msgChk)) {
|
||||
errMessage = "비정상접근입니다.";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
//05. 2차 복호화
|
||||
rec_cert = seed.getDec(encPara, k_certNum);
|
||||
kmcVO.setRecCert(rec_cert);
|
||||
//06. 2차 파싱
|
||||
int info1 = rec_cert.indexOf("/",0);
|
||||
int info2 = rec_cert.indexOf("/",info1+1);
|
||||
int info3 = rec_cert.indexOf("/",info2+1);
|
||||
int info4 = rec_cert.indexOf("/",info3+1);
|
||||
int info5 = rec_cert.indexOf("/",info4+1);
|
||||
int info6 = rec_cert.indexOf("/",info5+1);
|
||||
int info7 = rec_cert.indexOf("/",info6+1);
|
||||
int info8 = rec_cert.indexOf("/",info7+1);
|
||||
int info9 = rec_cert.indexOf("/",info8+1);
|
||||
int info10 = rec_cert.indexOf("/",info9+1);
|
||||
int info11 = rec_cert.indexOf("/",info10+1);
|
||||
int info12 = rec_cert.indexOf("/",info11+1);
|
||||
int info13 = rec_cert.indexOf("/",info12+1);
|
||||
int info14 = rec_cert.indexOf("/",info13+1);
|
||||
int info15 = rec_cert.indexOf("/",info14+1);
|
||||
int info16 = rec_cert.indexOf("/",info15+1);
|
||||
int info17 = rec_cert.indexOf("/",info16+1);
|
||||
int info18 = rec_cert.indexOf("/",info17+1);
|
||||
|
||||
certNum = rec_cert.substring(0,info1); kmcVO.setCertNum(certNum);
|
||||
date = rec_cert.substring(info1+1,info2); kmcVO.setDate(date);
|
||||
CI = rec_cert.substring(info2+1,info3); kmcVO.setCI(CI);
|
||||
phoneNo = rec_cert.substring(info3+1,info4); kmcVO.setPhoneNo(phoneNo);
|
||||
phoneCorp = rec_cert.substring(info4+1,info5); kmcVO.setPhoneCorp(phoneCorp);
|
||||
birthDay = rec_cert.substring(info5+1,info6); kmcVO.setBirthDay(birthDay);
|
||||
gender = rec_cert.substring(info6+1,info7); kmcVO.setGender(gender);
|
||||
nation = rec_cert.substring(info7+1,info8); kmcVO.setNation(nation);
|
||||
name = rec_cert.substring(info8+1,info9); kmcVO.setName(name);
|
||||
result = rec_cert.substring(info9+1,info10); kmcVO.setResult(result);
|
||||
certMet = rec_cert.substring(info10+1,info11); kmcVO.setCertMet(certMet);
|
||||
ip = rec_cert.substring(info11+1,info12); kmcVO.setIp(ip);
|
||||
M_name = rec_cert.substring(info12+1,info13); kmcVO.setMName(M_name);
|
||||
M_birthDay = rec_cert.substring(info13+1,info14); kmcVO.setMBirthDay(M_birthDay);
|
||||
M_Gender = rec_cert.substring(info14+1,info15); kmcVO.setMGender(M_Gender);
|
||||
M_nation = rec_cert.substring(info15+1,info16); kmcVO.setMNation(M_nation);
|
||||
plusInfo = rec_cert.substring(info16+1,info17); kmcVO.setPlusInfo(plusInfo);
|
||||
DI = rec_cert.substring(info17+1,info18); kmcVO.setDI(DI);
|
||||
|
||||
//07. CI, DI 복호화
|
||||
CI = seed.getDec(CI, k_certNum); kmcVO.setCI(CI);
|
||||
DI = seed.getDec(DI, k_certNum); kmcVO.setDI(DI);
|
||||
|
||||
if("Y".equals(result)) {
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
String regex = "";
|
||||
if( certNum.length() == 0 || certNum.length() > 40){
|
||||
errMessage = "요청번호 비정상.";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( date.length() != 14 || !paramChk(regex, date) ){
|
||||
errMessage = "요청일시";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if( certMet.length() != 1 || !paramChk(regex, certMet) ){
|
||||
errMessage = "본인인증방법 비정상" + certMet;
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( (phoneNo.length() != 10 && phoneNo.length() != 11) || !paramChk(regex, phoneNo) ){
|
||||
errMessage = "휴대폰번호 비정상" ;
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if( phoneCorp.length() != 3 || !paramChk(regex, phoneCorp) ){
|
||||
errMessage = "이동통신사 비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( birthDay.length() != 8 || !paramChk(regex, birthDay) ){
|
||||
errMessage = "생년월일 비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( gender.length() != 1 || !paramChk(regex, gender) ){
|
||||
errMessage = "성별 비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( nation.length() != 1 || !paramChk(regex, nation) ){
|
||||
errMessage = "내/외국인 비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-<2D>R.,-]*";
|
||||
if( name.length() > 60 || !paramChk(regex, name) ){
|
||||
errMessage = "성명 비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if( result.length() != 1 || !paramChk(regex, result) ){
|
||||
errMessage = "결과값 비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-?.,-]*";
|
||||
if( M_name.length() != 0 ){
|
||||
if( M_name.length() > 60 || !paramChk(regex, M_name) ){
|
||||
errMessage = "미성년자 성명 비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( M_birthDay.length() != 0 ){
|
||||
if( M_birthDay.length() != 8 || !paramChk(regex, M_birthDay) ){
|
||||
errMessage = "미성년자 생년월일 비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( M_Gender.length() != 0 ){
|
||||
if( M_Gender.length() != 1 || !paramChk(regex, M_Gender) ){
|
||||
errMessage = "미성년자 성별 비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if( M_nation.length() != 0 ){
|
||||
if( M_nation.length() != 1 || !paramChk(regex, M_nation) ){
|
||||
errMessage = "미성년자 내/외국인 비정상";
|
||||
return returnPage(model , errMessage , kmcVO) ;
|
||||
}
|
||||
}
|
||||
|
||||
//본인인증 결과 내용 저장하기.
|
||||
/*System.out.println("+++++++++++++ getCertNum ::: "+kmcVO.getCertNum());
|
||||
System.out.println("+++++++++++++ getDate ::: "+kmcVO.getDate());
|
||||
System.out.println("+++++++++++++ getDI ::: "+kmcVO.getDI());
|
||||
System.out.println("+++++++++++++ getPhoneNo ::: "+kmcVO.getPhoneNo());
|
||||
System.out.println("+++++++++++++ getNation ::: "+kmcVO.getNation());
|
||||
System.out.println("+++++++++++++ getName ::: "+kmcVO.getName());
|
||||
System.out.println("+++++++++++++ getResult ::: "+kmcVO.getResult());
|
||||
System.out.println("+++++++++++++ getCertMet ::: "+kmcVO.getCertMet());
|
||||
System.out.println("+++++++++++++ getIp ::: "+kmcVO.getIp());*/
|
||||
|
||||
//KMC 본인인증 정보를 세션에 담아준다.
|
||||
/*AuthCertVO certVO = new AuthCertVO();
|
||||
certVO.setCertNum(kmcVO.getCertNum());
|
||||
certVO.setCertDate(kmcVO.getDate());
|
||||
certVO.setCertDi(kmcVO.getDI());
|
||||
certVO.setCertPhone(kmcVO.getPhoneNo());
|
||||
certVO.setCertNation(kmcVO.getNation());
|
||||
certVO.setCertName(kmcVO.getName());
|
||||
certVO.setCertResult(kmcVO.getResult());
|
||||
certVO.setCertType("KMC문자인증");
|
||||
certVO.setCertIpaddr(kmcVO.getIp());
|
||||
certVO.setBirthDay(kmcVO.getBirthDay());
|
||||
certVO.setSexdstnCode(kmcVO.getGender());*/
|
||||
|
||||
/*request.getSession().setAttribute("AuthKmcCertVO", certVO);*/
|
||||
|
||||
/*System.out.println("++++++++++++ 세션체크22 ::: "+(MberManageVO) session.getAttribute("mberSession"));*/
|
||||
|
||||
//KMC 본인인증 로그 insert
|
||||
AuthCertVO certVO = new AuthCertVO();
|
||||
certVO.setMberId(kmcVO.getPlusInfo());
|
||||
certVO.setCertNum(kmcVO.getCertNum());
|
||||
certVO.setCertDate(kmcVO.getDate());
|
||||
certVO.setCertDi(kmcVO.getDI());
|
||||
certVO.setCertPhone(kmcVO.getPhoneNo());
|
||||
certVO.setCertNation(kmcVO.getNation());
|
||||
certVO.setCertName(kmcVO.getName());
|
||||
certVO.setCertResult(kmcVO.getResult());
|
||||
certVO.setCertType("KMC_회원가입 인증");
|
||||
certVO.setCertIpaddr(kmcVO.getIp());
|
||||
certVO.setBirthDay(kmcVO.getBirthDay());
|
||||
certVO.setSexdstnCode(kmcVO.getGender());
|
||||
|
||||
//디비 테이블에 저장하기
|
||||
mberManageService.insertCertInfoLog(certVO);
|
||||
|
||||
kmcVO.setIdx(certVO.getIdx()); //본인인증 로그 Idx - 로그 insert 후 idx selectKey
|
||||
model.addAttribute("kmcVO", kmcVO);
|
||||
@ -2347,17 +2603,16 @@ public class MjonPayController {
|
||||
* 2023.12.22 우영두
|
||||
* @param mjonMsgVO
|
||||
* @param model
|
||||
* @return "/web/member/pay/payUserSWList.do"
|
||||
* @return "/web/member/pay/PayUserSWList.do"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value= {"/web/member/pay/payUserSWList.do"})
|
||||
public String payUserSWList(@ModelAttribute("mjonMsgVO") MjonMsgVO mjonMsgVO,
|
||||
@RequestMapping(value= {"/web/member/pay/PayUserSWList.do"})
|
||||
public String PayUserSWList(@ModelAttribute("mjonMsgVO") MjonMsgVO mjonMsgVO,
|
||||
MjonPayVO mjonPayVO,
|
||||
MberManageVO mberManageVO, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request,
|
||||
ModelMap model) throws Exception{
|
||||
|
||||
|
||||
/*LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();*/
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
|
||||
@ -2366,26 +2621,117 @@ public class MjonPayController {
|
||||
return "redirect:/web/user/login/login.do";
|
||||
}
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
mjonMsgVO.setUserId(userId);
|
||||
/*
|
||||
{ // 충전캐시
|
||||
String sumPayMoney = mjonPayService.selectAgentSumPayMoney(userId);
|
||||
model.addAttribute("sumPayMoney", sumPayMoney);
|
||||
}
|
||||
|
||||
{ // 충전포인트
|
||||
String sumPoint = mjonPayService.selectSumPoint(userId);
|
||||
model.addAttribute("sumPoint", sumPoint);
|
||||
}
|
||||
*/
|
||||
|
||||
{ // 총 사용금액
|
||||
mjonPayVO.setUserId(userId);
|
||||
List<MjonPayVO> usedCashTotList = mjonPayService.selectUsedCashWithKakaoTotCnt(mjonPayVO);
|
||||
model.addAttribute("usedCashTotList", usedCashTotList);
|
||||
}
|
||||
{ // 사용가능한 금액
|
||||
// mberManageVO.prePaymentYn 선불 후불 회원 구분으로 인해 select함
|
||||
mberManageVO = mjonMsgDataService.selectMberManageInfo(userId);
|
||||
model.addAttribute("mberManageVO", mberManageVO);
|
||||
}
|
||||
/*
|
||||
{ // 발송건수
|
||||
mjonMsgVO.setReserveYn("N");
|
||||
List<MjonMsgVO> sendTotList = mjonMsgService.selectWithKakaoSendTotCnt(mjonMsgVO);
|
||||
model.addAttribute("sendTotList", sendTotList);
|
||||
}
|
||||
|
||||
{ // 예약건수
|
||||
mjonMsgVO.setReserveYn("Y");
|
||||
List<MjonMsgVO> reservToList = mjonMsgService.selectWithKakaoSendTotCnt(mjonMsgVO);
|
||||
model.addAttribute("reservToList", reservToList);
|
||||
}
|
||||
*/
|
||||
{// 선거 후보자 정보 조회
|
||||
MjonCandidateVO mjonCandidateVO = new MjonCandidateVO();
|
||||
if("p".equals(mberManageVO.getDept())) { //개인회원 선거 후보자 정보 불러오기
|
||||
mjonCandidateVO = mjonCandidateService.selectCandidateDataInfo(userId);
|
||||
if(mjonCandidateVO != null) {
|
||||
mjonCandidateVO.setRegidentNo1(egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo1()));
|
||||
mjonCandidateVO.setRegidentNo2(egovCryptoUtil.decrypt(mjonCandidateVO.getRegidentNo2()));
|
||||
}
|
||||
}
|
||||
model.addAttribute("mjonCandidateVO", mjonCandidateVO);
|
||||
}
|
||||
|
||||
|
||||
// // 비즈니스 로직 부분
|
||||
Map<String, Object> resultMap = mjonPayService.payUserSWList(mjonPayVO);
|
||||
{
|
||||
/**
|
||||
* 후불제 회원 관련 사용 요금 내역 정보 조회하기
|
||||
* 20231228 우영두 추가
|
||||
* 누적사용금액, 누적 납부금액, 당월 납부 예상금액 정보 조회
|
||||
*
|
||||
* */
|
||||
|
||||
//누적 사용금액 조회 (캐시 테이블에서 현재까지 사용된 금액 합산 - 캐시 테이블에서 "-"로 사용된 금액만 합산)
|
||||
String totSumCashAfterPay = mjonPayService.selectTotalSumCashForAfterPay(userId);
|
||||
model.addAttribute("totSumCashAfterPay", totSumCashAfterPay);
|
||||
|
||||
model.addAttribute("usedCashTotList", resultMap.get("usedCashTotList"));
|
||||
model.addAttribute("mjonCandidateVO", resultMap.get("mjonCandidateVO"));
|
||||
model.addAttribute("mberManageVO", resultMap.get("mberManageVO"));
|
||||
model.addAttribute("totSumCashAfterPay", resultMap.get("totSumCashAfterPay"));
|
||||
model.addAttribute("totSumPointAfterPay", resultMap.get("totSumPointAfterPay"));
|
||||
model.addAttribute("totSumPaymentAfterPay", resultMap.get("totSumPaymentAfterPay"));
|
||||
model.addAttribute("sumPaymentPointAfterPay", resultMap.get("sumPaymentPointAfterPay"));
|
||||
model.addAttribute("unPaymentAfterPay", resultMap.get("unPaymentAfterPay"));
|
||||
model.addAttribute("unPaymentPointAfterPay", resultMap.get("unPaymentPointAfterPay"));
|
||||
model.addAttribute("negoPriceYn", resultMap.get("negoPriceYn"));
|
||||
model.addAttribute("startDate", resultMap.get("startDate"));
|
||||
model.addAttribute("endDate", resultMap.get("endDate"));
|
||||
//누적 사용 포인트 조회 (포인트 테이블에서 현재까지 사용된 포인트 합산 - 회원 포인트 정보 업데이트시 사용되는 쿼리 이용)
|
||||
String totSumPointAfterPay = mjonPayService.selectTotalSumPointForAfterPay(userId);
|
||||
model.addAttribute("totSumPointAfterPay", totSumPointAfterPay);
|
||||
|
||||
//누적 납부금액 조회 (후불회원이 사용금액을 실 납부한 금액 합산 - 미납 금액 제외한 총 합산 금액)
|
||||
String totSumPaymentAfterPay = mjonPayService.selectTotSumPaymentAfterPay(userId);
|
||||
model.addAttribute("totSumPaymentAfterPay", totSumPaymentAfterPay);
|
||||
|
||||
//누적 납부 포인트 조회 ( 누적 납부금액 합산에 대한 2% 포인트 정보 계산)
|
||||
float p_i_re_point = 0;
|
||||
JoinSettingVO sysJoinSetVO = mjonMsgDataService.selectJoinSettingInfo();
|
||||
if (sysJoinSetVO != null) {
|
||||
p_i_re_point = sysJoinSetVO.getPointPer();
|
||||
}
|
||||
int paymentPointAfterPay = Math.round((Float.parseFloat(totSumPaymentAfterPay) * p_i_re_point / 100));
|
||||
model.addAttribute("sumPaymentPointAfterPay", paymentPointAfterPay);
|
||||
|
||||
//당월 납부 예상금액 (누적 사용금액 합산 - 누적 납부금액 합산 정보 계산)
|
||||
|
||||
float unPaymentAfterPay = Float.parseFloat(totSumCashAfterPay) - Float.parseFloat(totSumPaymentAfterPay);
|
||||
model.addAttribute("unPaymentAfterPay", unPaymentAfterPay);
|
||||
|
||||
//당월 납부 예상 포인트 (당월 납부 예상 금액에 대한 2% 포인트 정보 계산)
|
||||
int unPaymentPointAfterPay = Math.round((unPaymentAfterPay * p_i_re_point / 100));
|
||||
model.addAttribute("unPaymentPointAfterPay", unPaymentPointAfterPay);
|
||||
|
||||
/*
|
||||
* 2024.02.06 후불제 회원 중 협의단가를 사용하는 회원은 포인트 적립이 되지 않아야함.
|
||||
* 후불제 협의 단가 여부 체크
|
||||
* 모든 협의 단가 금액을 합산하여 0보다 크면 협의단가 있음.
|
||||
* */
|
||||
float shortPrice = mberManageVO.getShortPrice();
|
||||
float longPrice = mberManageVO.getLongPrice();
|
||||
float picturePrice = mberManageVO.getPicturePrice() + mberManageVO.getPicture2Price() + mberManageVO.getPicture3Price();
|
||||
float kakaoAtPrice = mberManageVO.getKakaoAtPrice();
|
||||
float kakaoFtPrice = mberManageVO.getKakaoFtPrice();
|
||||
float totPrice = shortPrice + longPrice + picturePrice + kakaoAtPrice + kakaoFtPrice;
|
||||
String negoPriceYn = "N";
|
||||
|
||||
if(totPrice > 0) {
|
||||
negoPriceYn = "Y";
|
||||
}
|
||||
model.addAttribute("negoPriceYn", negoPriceYn);
|
||||
|
||||
}
|
||||
{
|
||||
// 초기 날짜 셋팅
|
||||
model.addAttribute("startDate", DateUtils.getDateMonthsAgo(12));
|
||||
model.addAttribute("endDate", DateUtils.getCurrentDate());
|
||||
}
|
||||
|
||||
return "/web/pay/PayUserSWList";
|
||||
}
|
||||
@ -2403,8 +2749,8 @@ public class MjonPayController {
|
||||
* @return "/web/member/pay/PayUserSWListAjax.do"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value= {"/web/member/pay/payUserSWListAjax.do"})
|
||||
public String payUserSWListAjax(@ModelAttribute("searchVO") MjonMsgVO mjonMsgVO,
|
||||
@RequestMapping(value= {"/web/member/pay/PayUserSWListAjax.do"})
|
||||
public String PayUserSWListAjax(@ModelAttribute("searchVO") MjonMsgVO mjonMsgVO,
|
||||
HttpServletRequest request,
|
||||
ModelMap model) throws Exception{
|
||||
|
||||
@ -2428,12 +2774,29 @@ public class MjonPayController {
|
||||
mjonMsgVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
mjonMsgVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
Map<String, Object> resultMap = mjonPayService.payUserSWListAjax(mjonMsgVO);
|
||||
if("".equals(mjonMsgVO.getSearchSortCnd())){ //최초조회시 최신것 조회List
|
||||
mjonMsgVO.setSearchSortCnd("regDate");
|
||||
mjonMsgVO.setSearchSortOrd("desc");
|
||||
}
|
||||
|
||||
paginationInfo.setTotalRecordCount((int)resultMap.get("totCnt"));
|
||||
// 검색 데이터가 없거나
|
||||
// 시작일자가 종료일자보다 이후이거나
|
||||
// 총 기간이 365일이 넘으면 현재일부터 365일 전 날짜를 넣어서 검색
|
||||
if(!DateUtils.dateChkAndValueChk(mjonMsgVO.getStartDate(),mjonMsgVO.getEndDate(), 12 )) {
|
||||
|
||||
mjonMsgVO.setStartDate(DateUtils.getDateMonthsAgo(12));
|
||||
mjonMsgVO.setEndDate(DateUtils.getCurrentDate());
|
||||
|
||||
};
|
||||
|
||||
List<MjonMsgVO> payUserSWList = mjonMsgDataService.selectPayUserSWList(mjonMsgVO);
|
||||
|
||||
paginationInfo.setTotalRecordCount(payUserSWList.size()> 0 ? payUserSWList.get(0).getTotCnt() : 0);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
model.addAttribute("payUserSWList", resultMap.get("payUserSWList"));
|
||||
model.addAttribute("totSuccSendPrice", resultMap.get("totSuccSendPrice"));
|
||||
model.addAttribute("payUserSWList", payUserSWList);
|
||||
|
||||
model.addAttribute("totSuccSendPrice", payUserSWList.size() > 0 ? PayUtils.getTrimToFirstDecimal(payUserSWList.get(0).getTotSuccSendPrice()) : 0);
|
||||
|
||||
model.addAttribute("mjonMsgVO", mjonMsgVO);
|
||||
|
||||
|
||||
@ -2515,7 +2878,7 @@ public class MjonPayController {
|
||||
font.setBoldweight(Font.BOLDWEIGHT_BOLD); //글씨 bold
|
||||
|
||||
sheet.setColumnWidth(1, 5000); // 칼럼의 폭 조절
|
||||
sheet.setColumnWidth(3, 10000); // 칼럼의 폭 조절
|
||||
sheet.setColumnWidth(4, 10000); // 칼럼의 폭 조절
|
||||
|
||||
try{
|
||||
|
||||
@ -2540,7 +2903,6 @@ public class MjonPayController {
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,1,1)); //셀병합
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,2,2)); //셀병합
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,3,3)); //셀병합
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,1,6,6)); //셀병합
|
||||
|
||||
|
||||
cell = row.createCell(0);
|
||||
@ -2548,29 +2910,46 @@ public class MjonPayController {
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(1);
|
||||
cell.setCellValue("발송일시");
|
||||
cell.setCellValue("날짜");
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(2);
|
||||
cell.setCellValue("형태");
|
||||
cell.setCellValue("문자유형");
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(3);
|
||||
cell.setCellValue("내용");
|
||||
cell.setCellValue("발송건수");
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(4);
|
||||
cell.setCellValue("발송건수");
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,0,4,5)); //셀병합
|
||||
cell.setCellValue("내용");
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(5);
|
||||
/*cell = row.createCell(5);
|
||||
cell.setCellValue("충전");
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,0,5,6)); //셀병합
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(6);
|
||||
cell.setCellValue("금액(원)");
|
||||
cell.setCellStyle(style);*/
|
||||
|
||||
cell = row.createCell(5);
|
||||
cell.setCellValue("사용");
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,0,5,6)); //셀병합
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(6);
|
||||
cell.setCellStyle(style);
|
||||
|
||||
|
||||
/*cell = row.createCell(9);
|
||||
cell.setCellValue("잔액");
|
||||
sheet.addMergedRegion(new CellRangeAddress(0,0,9,10)); //셀병합
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(10);
|
||||
cell.setCellStyle(style);*/
|
||||
|
||||
row = sheet.createRow(1);
|
||||
|
||||
cell = row.createCell(0);
|
||||
@ -2586,16 +2965,32 @@ public class MjonPayController {
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(4);
|
||||
cell.setCellValue("성공");
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(5);
|
||||
cell.setCellValue("실패");
|
||||
/*cell = row.createCell(5);
|
||||
cell.setCellValue("충전금");
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(6);
|
||||
cell.setCellValue("포인트");
|
||||
cell.setCellStyle(style);*/
|
||||
|
||||
cell = row.createCell(5);
|
||||
cell.setCellValue("충전금");
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(6);
|
||||
cell.setCellValue("포인트");
|
||||
cell.setCellStyle(style);
|
||||
|
||||
/*cell = row.createCell(9);
|
||||
cell.setCellValue("충전금");
|
||||
cell.setCellStyle(style);
|
||||
|
||||
cell = row.createCell(10);
|
||||
cell.setCellValue("포인트");
|
||||
cell.setCellStyle(style);*/
|
||||
|
||||
DecimalFormat formatter = new DecimalFormat("###,###.##");
|
||||
String befCash = "";
|
||||
String befPoint = "";
|
||||
@ -2638,11 +3033,15 @@ public class MjonPayController {
|
||||
if(j==0) cell.setCellValue(i+1); //번호
|
||||
if(j==1) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getRegDate()); //결제일시
|
||||
if(j==2) cell.setCellValue(msgType); //문자유형
|
||||
if(j==3) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getSmsTxt()); //내용
|
||||
if(j==4) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getSuccSendCnt()); //성공건수
|
||||
if(j==5) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getFailSendCnt()); //실패건수
|
||||
if(j==6) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getSuccSendPrice()); //금액
|
||||
}
|
||||
if(j==3) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getSuccSendCnt()); //발송건수
|
||||
if(j==4) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getSmsTxt()); //내용
|
||||
if(j==5) cell.setCellValue(((MjonMsgVO)payUserList.get(i)).getSuccSendPrice()); //충전 - 충전금
|
||||
if(j==6) cell.setCellValue(0); //충전 - 포인트
|
||||
/*if(j==7) cell.setCellValue(totPrice); //사용 - 충전금
|
||||
if(j==8) cell.setCellValue(0); //사용 - 포인트
|
||||
if(j==9) cell.setCellValue(thisPoint); //잔액 - 충전금
|
||||
if(j==10) cell.setCellValue(befPoint); //잔액 - 포인트
|
||||
*/ }
|
||||
}
|
||||
}
|
||||
response.setHeader("Set-Cookie", "fileDownload=true; path=/");
|
||||
@ -4645,19 +5044,35 @@ public class MjonPayController {
|
||||
model.addAttribute("endDate", endDate);
|
||||
|
||||
DecimalFormat decFormat = new DecimalFormat("###,###");
|
||||
DecimalFormat decFormatFloat = new DecimalFormat("###,###.#");
|
||||
model.addAttribute("sendSumCount", decFormat.format(sendSumCount));
|
||||
model.addAttribute("supplySumPrice", decFormat.format(supplySumPrice));
|
||||
model.addAttribute("vatSumPrice", decFormat.format(vatSumPrice));
|
||||
model.addAttribute("totalSumPrice", decFormatFloat.format(totalSumPrice));
|
||||
model.addAttribute("totalSumPrice", decFormat.format(totalSumPrice));
|
||||
model.addAttribute("resultList", payUserSumList);
|
||||
|
||||
// 수신자 정보
|
||||
MJUtil mjUtil = new MJUtil();
|
||||
MberManageVO mberManageVO = mjonMsgDataService.selectMberManageInfo(userId);
|
||||
mberManageVO.setMoblphonNo(mjUtil.addDash(mberManageVO.getMoblphonNo()));
|
||||
mberManageVO.setBizNo(mjUtil.bizNoAddDash(mberManageVO.getBizNo()));
|
||||
model.addAttribute("mberManageVO", mberManageVO);
|
||||
String mberNm = ""; // 회사명
|
||||
String managerNm = ""; // 담당자명
|
||||
String moblphonNo = ""; // 연락처
|
||||
MberManageVO mberManageVO = new MberManageVO();
|
||||
mberManageVO = mjonMsgDataService.selectMberManageInfo(userId);
|
||||
if (mberManageVO != null) {
|
||||
// 회원종류 p-개인 c-기업
|
||||
if (mberManageVO.getDept().equals("c")) {
|
||||
mberNm = mberManageVO.getMberNm();
|
||||
managerNm = mberManageVO.getManagerNm();
|
||||
moblphonNo = mberManageVO.getMoblphonNo();
|
||||
}
|
||||
else {
|
||||
mberNm = mberManageVO.getMberNm();
|
||||
managerNm = mberManageVO.getMberNm();
|
||||
moblphonNo = mberManageVO.getMoblphonNo();
|
||||
}
|
||||
}
|
||||
|
||||
model.addAttribute("mberNm", mberNm);
|
||||
model.addAttribute("managerNm", managerNm);
|
||||
model.addAttribute("moblphonNo", moblphonNo);
|
||||
|
||||
//부가세 포함 가격 정보 계산
|
||||
double addTax = Math.round(totalSumPrice * 0.1);
|
||||
@ -5776,41 +6191,6 @@ public class MjonPayController {
|
||||
return "/uss/ion/pay/cashPointSendList";
|
||||
}
|
||||
|
||||
/**
|
||||
* * 거래명세서 팝업
|
||||
* @param searchVO
|
||||
* @param model
|
||||
* @return "/web/member/pay/payInvoicePopupAjax.do"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value= {"/web/member/pay/payInvoicePopupAjax.do"})
|
||||
public String printInvoiceAjax(
|
||||
@ModelAttribute("searchVO") MjonPayVO mjonPayVO
|
||||
, RedirectAttributes redirectAttributes
|
||||
, ModelMap model) throws Exception {
|
||||
|
||||
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(loginVO == null) {
|
||||
//redirectAttributes.addFlashAttribute("message", "문자온 서비스는 로그인 후 이용 가능합니다.");
|
||||
return "redirect:/web/user/login/login.do";
|
||||
}
|
||||
|
||||
mjonPayVO.setUserId(userId);
|
||||
|
||||
//결제 정보 불러오기
|
||||
MJUtil mjUtil = new MJUtil();
|
||||
MjonPayVO result = mjonPayService.selectPayDetail(mjonPayVO);
|
||||
result.setMbtlNum(mjUtil.addDash(result.getMbtlNum()));
|
||||
result.setBizNo(mjUtil.bizNoAddDash(result.getBizNo()));
|
||||
model.addAttribute("result", result);
|
||||
|
||||
return "web/pay/payInvoicePrintPopup";
|
||||
}
|
||||
/**
|
||||
* @param p_pattern
|
||||
* @param p_mjonPayVO
|
||||
@ -5923,6 +6303,5 @@ public class MjonPayController {
|
||||
|
||||
return p_response;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -278,8 +278,6 @@ public class MjonPayV2Controller {
|
||||
try {
|
||||
// 다음 결제시 결제수단 SELECT
|
||||
nextPayMethod = userManageService.selectNextPayMethod(userId);
|
||||
// 실제 마지막 결제 방식 -
|
||||
|
||||
}
|
||||
catch(Exception e) {
|
||||
isSuccess = false;
|
||||
@ -1642,45 +1640,6 @@ public class MjonPayV2Controller {
|
||||
return "web/cop/kgmV2/bankOkUrl";
|
||||
}
|
||||
|
||||
/**
|
||||
* 마지막 결제수단 SELECT
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/web/member/pay/selectLastPayMethodAjax.do")
|
||||
public ModelAndView selectLastPayMethodAjax(MjonPayVO mjonPayVO,
|
||||
HttpServletRequest request ) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
boolean isSuccess = true;
|
||||
String msg = "";
|
||||
String nextPayMethod = "";
|
||||
|
||||
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
isSuccess = false;
|
||||
msg = "로그인이 필요합니다.";
|
||||
}
|
||||
|
||||
try {
|
||||
// 다음 결제시 결제수단 SELECT
|
||||
nextPayMethod = userManageService.selectLastPayMethod(userId);
|
||||
}
|
||||
catch(Exception e) {
|
||||
isSuccess = false;
|
||||
msg = e.getMessage();
|
||||
}
|
||||
|
||||
modelAndView.addObject("isSuccess", isSuccess);
|
||||
modelAndView.addObject("msg", msg);
|
||||
modelAndView.addObject("nextPayMethod", nextPayMethod);
|
||||
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
// Get Server Path
|
||||
public static String getKgServerPath(HttpServletRequest request) {
|
||||
String kgmPath = request.getScheme() + "://" + request.getServerName() +":" + request.getServerPort();
|
||||
|
||||
@ -42,7 +42,6 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
@ -895,11 +894,11 @@ public class TestController {
|
||||
serverNm = request.getScheme() + "://munjaon.co.kr";
|
||||
}
|
||||
|
||||
// AuthCertVO certVO = kmcCertCheck.authCertCheck(serverNm + "/web/cop/kmc/authRequestAjax.do");
|
||||
AuthCertVO certVO = kmcCertCheck.authCertCheck(serverNm + "/web/cop/kmc/authRequestAjax.do");
|
||||
|
||||
// model.addAttribute("tr_cert", certVO.getTr_cert());
|
||||
// model.addAttribute("tr_url", certVO.getTr_url());
|
||||
// model.addAttribute("tr_add", certVO.getTr_add());
|
||||
model.addAttribute("tr_cert", certVO.getTr_cert());
|
||||
model.addAttribute("tr_url", certVO.getTr_url());
|
||||
model.addAttribute("tr_add", certVO.getTr_add());
|
||||
|
||||
}
|
||||
|
||||
@ -3503,39 +3502,4 @@ public class TestController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/uss/ion/test/callNicepay.do")
|
||||
public String callNicepay(Model model) {
|
||||
String url = "https://dev.nicepay.co.kr/webapi/sslConnectionTest.jsp";
|
||||
String mid = "itn180208m"; // 실제 MID 값으로 변경
|
||||
|
||||
try {
|
||||
// RestTemplate 사용
|
||||
RestTemplate restTemplate = new RestTemplate();
|
||||
|
||||
// 헤더 설정
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
// 파라미터 설정
|
||||
MultiValueMap<String, String> params = new LinkedMultiValueMap<>();
|
||||
params.add("MID", mid);
|
||||
|
||||
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(params, headers);
|
||||
|
||||
// POST 요청
|
||||
ResponseEntity<String> response = restTemplate.postForEntity(url, request, String.class);
|
||||
|
||||
// JSP에 전달
|
||||
model.addAttribute("result", response.getBody());
|
||||
model.addAttribute("url", url);
|
||||
model.addAttribute("mid", mid);
|
||||
|
||||
} catch (Exception e) {
|
||||
model.addAttribute("result", "에러 발생: " + e.getMessage());
|
||||
}
|
||||
|
||||
return "uss/ion/test/TestNicePaySSL"; // nicepayResult.jsp로 이동
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -5,27 +5,18 @@ import java.math.RoundingMode;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.exception.FdlException;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
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.mjo.event.service.MjonEventService;
|
||||
import itn.let.mjo.event.service.MjonEventVO;
|
||||
import itn.let.mjo.event.service.impl.MjonEventDAO;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgDataService;
|
||||
import itn.let.mjo.msgdata.service.impl.MjonMsgDataDAO;
|
||||
import itn.let.mjo.pay.service.MjonPayVO;
|
||||
import itn.let.mjo.pay.service.impl.MjonPayDAO;
|
||||
import itn.let.sym.site.service.JoinSettingVO;
|
||||
import itn.let.uss.umt.service.MberManageVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -41,7 +32,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class PriceAndPoint {
|
||||
|
||||
@ -57,11 +47,6 @@ public class PriceAndPoint {
|
||||
@Resource(name = "egovMjonCashIdGnrService")
|
||||
private EgovIdGnrService idgenMjonCashId;
|
||||
|
||||
@Resource(name="kakaoAlimTalkDAO")
|
||||
private KakaoAlimTalkDAO kakaoAlimTalkDAO;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : getBefCash
|
||||
* @author : 이호영
|
||||
@ -129,120 +114,19 @@ public class PriceAndPoint {
|
||||
, String msgGroupId
|
||||
) throws Exception {
|
||||
|
||||
// MjonPayVO mjonPayVO = new MjonPayVO();
|
||||
// mjonPayVO.setCashId(idgenMjonCashId.getNextStringId());
|
||||
// mjonPayVO.setUserId(userId);
|
||||
// System.out.println(" + totPrice :: "+ totPrice);
|
||||
// mjonPayVO.setCash(totPrice);
|
||||
// mjonPayVO.setFrstRegisterId(userId);
|
||||
// mjonPayVO.setMemo(memo);
|
||||
// mjonPayVO.setMsgGroupId(msgGroupId);
|
||||
|
||||
insertCashAndPoint(userId, totPrice, memo, msgGroupId, null);
|
||||
|
||||
// mjonPayDAO.insertCash(mjonPayVO); //캐시
|
||||
// mjonPayDAO.updateMemberCash(mjonPayVO); //회원정보 업데이트
|
||||
|
||||
}
|
||||
/**
|
||||
* @methodName : insertCashAndPoint
|
||||
* @author : 이호영
|
||||
* @date : 2025. 7. 17.
|
||||
* @description : insertCashAndPoint 에서 환불으로 인해 userData 추가
|
||||
* @return : void
|
||||
* @param userId
|
||||
* @param totPrice
|
||||
* @param memo
|
||||
* @param msgGroupId
|
||||
* @param userData
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public void insertCashAndPoint(
|
||||
String userId
|
||||
, float totPrice
|
||||
, String memo
|
||||
, String msgGroupId
|
||||
, String userData
|
||||
) throws Exception {
|
||||
|
||||
MjonPayVO mjonPayVO = buildPayVO(userId, totPrice, memo, msgGroupId);
|
||||
|
||||
// 환불로 인해 userData가 추후 사용될 경우 여기에 처리
|
||||
if (StringUtils.isNotEmpty(userData)) { mjonPayVO.setOrderId(userData); }
|
||||
MjonPayVO mjonPayVO = new MjonPayVO();
|
||||
mjonPayVO.setCashId(idgenMjonCashId.getNextStringId());
|
||||
mjonPayVO.setUserId(userId);
|
||||
System.out.println(" + totPrice :: "+ totPrice);
|
||||
mjonPayVO.setCash(totPrice);
|
||||
mjonPayVO.setFrstRegisterId(userId);
|
||||
mjonPayVO.setMemo(memo);
|
||||
mjonPayVO.setMsgGroupId(msgGroupId);
|
||||
|
||||
mjonPayDAO.insertCash(mjonPayVO); //캐시
|
||||
mjonPayDAO.updateMemberCash(mjonPayVO); //회원정보 업데이트
|
||||
|
||||
}
|
||||
|
||||
private MjonPayVO buildPayVO(String userId, float totPrice, String memo, String msgGroupId) throws FdlException {
|
||||
MjonPayVO vo = new MjonPayVO();
|
||||
vo.setCashId(idgenMjonCashId.getNextStringId());
|
||||
vo.setUserId(userId);
|
||||
vo.setCash(totPrice);
|
||||
vo.setFrstRegisterId(userId);
|
||||
vo.setMemo(memo);
|
||||
vo.setMsgGroupId(msgGroupId);
|
||||
System.out.println(" + totPrice :: " + totPrice);
|
||||
return vo;
|
||||
}
|
||||
|
||||
public void insertBizFtKakaoPrice(String userId, String msgGroupId) throws Exception {
|
||||
KakaoVO kakaoVO = new KakaoVO();
|
||||
|
||||
System.out.println("=======================");
|
||||
// 사용자 개인 단가 정보 불러오기
|
||||
MberManageVO mberManageVO = mjonMsgDataDAO.selectMberManageInfo(userId);
|
||||
// 시스템 기본 단가 정보 불러오기
|
||||
JoinSettingVO sysJoinSetVO = mjonMsgDataDAO.selectJoinSettingInfo();
|
||||
KakaoSendUtil.getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice());
|
||||
// TODO Auto-generated method stub
|
||||
kakaoVO.setMsgGroupId(msgGroupId);
|
||||
|
||||
kakaoVO.setSmsPrice(KakaoSendUtil.getValidPrice(mberManageVO.getShortPrice(), sysJoinSetVO.getShortPrice()));
|
||||
kakaoVO.setMmsPrice(KakaoSendUtil.getValidPrice(mberManageVO.getLongPrice(), sysJoinSetVO.getLongPrice()));
|
||||
kakaoVO.setPicturePrice(KakaoSendUtil.getValidPrice(mberManageVO.getPicturePrice(), sysJoinSetVO.getPicturePrice()));
|
||||
|
||||
kakaoVO.setKakaoFtPrice(KakaoSendUtil.getValidPrice(mberManageVO.getKakaoFtPrice(), sysJoinSetVO.getKakaoFtPrice()));
|
||||
kakaoVO.setKakaoFtImgPrice(KakaoSendUtil.getValidPrice(mberManageVO.getKakaoFtImgPrice(), sysJoinSetVO.getKakaoFtImgPrice()));
|
||||
kakaoVO.setKakaoFtWideImgPrice(KakaoSendUtil.getValidPrice(mberManageVO.getKakaoFtWideImgPrice(), sysJoinSetVO.getKakaoFtWideImgPrice()));
|
||||
|
||||
|
||||
|
||||
kakaoAlimTalkDAO.insertKakaoSendPrice(kakaoVO);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : insertCashAndPoint
|
||||
* @author : 이지우
|
||||
* @date : 2025. 8. 14.
|
||||
* @description : insertCashAndPoint 에서 updateMemberCash 제외
|
||||
* @return : void
|
||||
* @param userId
|
||||
* @param totPrice
|
||||
* @param memo
|
||||
* @param msgGroupId
|
||||
* @param userData
|
||||
* @throws Exception
|
||||
*
|
||||
*/
|
||||
public void insertCashAndPointNoUpdate(
|
||||
String userId
|
||||
, float totPrice
|
||||
, String memo
|
||||
, String msgGroupId
|
||||
, String userData
|
||||
) throws Exception {
|
||||
|
||||
MjonPayVO mjonPayVO = buildPayVO(userId, totPrice, memo, msgGroupId);
|
||||
|
||||
// 환불로 인해 userData가 추후 사용될 경우 여기에 처리
|
||||
if (StringUtils.isNotEmpty(userData)) { mjonPayVO.setOrderId(userData); }
|
||||
|
||||
mjonPayDAO.insertCash(mjonPayVO); //캐시
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -47,11 +47,11 @@ public interface SchdlrManageService {
|
||||
//전용계좌 자동 충전 배치
|
||||
public void vacsAutoCharge() throws Exception;
|
||||
|
||||
//문자온 카카오톡 실패 건수 환불 배치
|
||||
public void kakaoFailPayBack() throws Exception;
|
||||
|
||||
//문자온 문자전송 실패 건수 환불 배치
|
||||
public void payBack(String type, int limitCout) throws Exception;
|
||||
|
||||
public void payBack_advc(String p_type) throws Exception;
|
||||
|
||||
//대체문자 결과 반영 배치
|
||||
public void updateKakaoResendResult() throws Exception;
|
||||
}
|
||||
|
||||
@ -2,9 +2,7 @@ package itn.let.schdlr.service;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.sql.DataSource;
|
||||
@ -26,16 +24,12 @@ import itn.let.fax.admin.service.FaxAdmService;
|
||||
import itn.let.fax.admin.service.FaxStatVO;
|
||||
import itn.let.kakao.admin.kakaoAt.service.MjonKakaoAtStatVO;
|
||||
import itn.let.kakao.admin.statistics.service.KakaoStatisticsService;
|
||||
import itn.let.kakao.kakaoComm.KakaoVO;
|
||||
import itn.let.kakao.user.kakaoAt.service.KakaoAlimTalkService;
|
||||
import itn.let.lett.service.LetterService;
|
||||
import itn.let.mail.service.MailTemplateService;
|
||||
import itn.let.mjo.mjocommon.MjonCommon;
|
||||
import itn.let.mjo.msg.service.MjonMsgService;
|
||||
import itn.let.mjo.msg.service.MjonMsgStatVO;
|
||||
import itn.let.mjo.msg.service.MjonMsgVO;
|
||||
import itn.let.mjo.msgdata.service.impl.MjonMsgDataDAO;
|
||||
import itn.let.mjo.pay.service.MjonPayService;
|
||||
import itn.let.mjo.pay.service.MjonPayVO;
|
||||
import itn.let.sts.com.StatsVO;
|
||||
import itn.let.sts.cst.service.EgovConectStatsService;
|
||||
import itn.let.uss.umt.service.EgovUserManageService;
|
||||
@ -88,15 +82,6 @@ public class SchedulerUtil {
|
||||
@Resource(name="MjonMsgDataDAO")
|
||||
private MjonMsgDataDAO mjonMsgDataDAO;
|
||||
|
||||
@Resource(name="kakaoAlimTalkService")
|
||||
private KakaoAlimTalkService kakaoAlimTalkService;
|
||||
|
||||
@Resource(name="MjonCommon")
|
||||
private MjonCommon mjonCommon;
|
||||
|
||||
@Resource(name = "mjonPayService")
|
||||
private MjonPayService mjonPayService;
|
||||
|
||||
/** 설정값 가져오기 */
|
||||
@Value("#{globalSettings['Globals.Env']}")
|
||||
private String GlobalsEnv;
|
||||
@ -481,51 +466,17 @@ public class SchedulerUtil {
|
||||
return new JdbcTemplateLockProvider(dataSource);
|
||||
}
|
||||
|
||||
// @Scheduled(cron = "0 0 0/2 * * ?") // 매시간 짝수 정각마다 실행
|
||||
@Scheduled(cron = "0 0/3 * * * ?") // 3분마다 실행
|
||||
@SchedulerLock(name = "runKakaoOneTime", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
|
||||
public void runKakaoOneTime() throws Exception {
|
||||
|
||||
/* 회원 money 업데이트 처리 트랜잭션 분리를 위하여 impl이 아닌 현재 위치에서 반복문 실행 */
|
||||
// do something...
|
||||
try {
|
||||
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);;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//대체문자 결과 반영
|
||||
@Scheduled(cron = "0 0/2 * * * ?") // 2분마다 실행
|
||||
@SchedulerLock(name = "updateKakaoResendResult", lockAtMostForString = ONE_MIN, lockAtLeastForString = ONE_MIN)
|
||||
public void runUpdateKakaoResendResult() throws Exception {
|
||||
|
||||
try {
|
||||
System.out.println("=============SchedulerUtil=====runUpdateKakaoResendResult =============>");
|
||||
schdlrManageService.updateKakaoResendResult();
|
||||
schdlrManageService.kakaoFailPayBack();
|
||||
}catch(Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//환불 실행
|
||||
|
||||
@ -393,12 +393,12 @@ public class SchdlrManageServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
// 대상 : 휴대폰결제, 즉시이체, 전용계좌
|
||||
// Step 1. 스미싱의심 지정 여부
|
||||
// JoinSettingVO joinSettingVO = new JoinSettingVO();
|
||||
JoinSettingVO joinSettingVO = egovSiteManagerService.selectAdminNotiDetail();
|
||||
JoinSettingVO joinSettingVO = new JoinSettingVO();
|
||||
joinSettingVO = egovSiteManagerService.selectAdminNotiDetail();
|
||||
if (joinSettingVO != null && joinSettingVO.getSmishingNoti().equals("Y")) {
|
||||
// Step 1. 개인회원 여부 체크
|
||||
// int isPersnalMemberCnt = egovSiteManagerService.selectPersnalMemberCnt(Userid);
|
||||
// if (isPersnalMemberCnt == 1) {
|
||||
int isPersnalMemberCnt = egovSiteManagerService.selectPersnalMemberCnt(Userid);
|
||||
if (isPersnalMemberCnt == 1) {
|
||||
// Step 2. 첫결제 여부 체크
|
||||
int isFirstPayCnt = egovSiteManagerService.selectFirstPayCnt(Userid);
|
||||
if (isFirstPayCnt == 1) {
|
||||
@ -418,11 +418,10 @@ public class SchdlrManageServiceImpl extends EgovAbstractServiceImpl implements
|
||||
// 스미싱 의심회원으로 변경
|
||||
UserManageVO userManageVO = new UserManageVO();
|
||||
userManageVO.setSmishingYn("Y");
|
||||
userManageVO.setAtSmishingYn("Y");
|
||||
userManageVO.setMberId(Userid);
|
||||
userManageService.updateOneUserSmishingYnNotAlert(userManageVO);
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
@ -438,6 +437,17 @@ public class SchdlrManageServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
}
|
||||
|
||||
// 카카오 환불 처리 리스트
|
||||
public void kakaoFailPayBack() throws Exception {
|
||||
|
||||
// 카카오 알림톡 환불 처리
|
||||
kakaoAlimTalkService.selectKakaoAtSentRefundList();
|
||||
|
||||
// 카카오 친구톡 환불 처리
|
||||
kakaoAlimTalkService.selectKakaoFtSentRefundList();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void payBack(String type, int limitCout) throws Exception {
|
||||
// 문자 환불
|
||||
@ -556,37 +566,4 @@ public class SchdlrManageServiceImpl extends EgovAbstractServiceImpl implements
|
||||
|
||||
return msgFailList;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @methodName : updateKakaoResendResult
|
||||
* @author : 이지우
|
||||
* @date : 2025.07.15
|
||||
* @description : 대체문자 결과 반영
|
||||
* @param p_type
|
||||
* @param request
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void updateKakaoResendResult() throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
// 대체문자 대상 조회
|
||||
List<MjonMsgVO> resendLogList = mjonMsgDataDAO.selectBizResendLogList();
|
||||
for(MjonMsgVO vo : resendLogList) {
|
||||
if("4100".equals(vo.getResultCode())
|
||||
|| "6600".equals(vo.getResultCode())
|
||||
|| "7000".equals(vo.getResultCode())) {
|
||||
vo.setMsgResult("40");
|
||||
}else {
|
||||
vo.setMsgResult("50");
|
||||
}
|
||||
mjonMsgDataDAO.updateResendResult(vo);
|
||||
mjonMsgDataDAO.deleteBizResendLog(vo);
|
||||
}
|
||||
long endTime = System.currentTimeMillis();
|
||||
long elapsedTime = (endTime - startTime) / 1000; // 초 단위 변환
|
||||
System.out.println("updateKakaoResendResult 실행 시간: " + elapsedTime + "초 (" + resendLogList.size() + "건 처리)");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,5 @@
|
||||
package itn.let.sym.site.service;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 로그인정책에 대한 VO 클래스를 정의한다.
|
||||
* 로그인정책정보의 목록 항목을 관리한다.
|
||||
@ -25,18 +18,13 @@ import lombok.ToString;
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@ToString
|
||||
public class JoinSettingVO {
|
||||
|
||||
/**
|
||||
* serialVersionUID
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private float shortPrice; // 단문 단가
|
||||
private float longPrice; //장문 단가
|
||||
@ -49,9 +37,6 @@ public class JoinSettingVO {
|
||||
private float customTextPrice; // 텍스트 단순수정
|
||||
private float kakaoAtPrice; // 카카오 알림톡 단가
|
||||
private float kakaoFtPrice; // 카카오 친구톡 단가
|
||||
private float kakaoFtImgPrice; // 카카오 친구톡 이미지 단가
|
||||
private float kakaoFtWideImgPrice; // 카카오 친구톡 와이드 단가
|
||||
|
||||
private float faxPrice; // 팩스 단가
|
||||
|
||||
private float refundPer; //환불 비율
|
||||
@ -65,7 +50,189 @@ public class JoinSettingVO {
|
||||
private String slackNoti; //관리자 SLACK 알림 여부
|
||||
private String smishingNoti; //첫결제(카드제외) 스미싱의심 알림 여부
|
||||
private String holiSmishingNoti; //야간 스미싱알림 여부
|
||||
private String smsNotiIfOverFifty; //50건이상 문자발송 시 안내문자 발송
|
||||
|
||||
public String getSmishingNoti() {
|
||||
return smishingNoti;
|
||||
}
|
||||
|
||||
public void setSmishingNoti(String smishingNoti) {
|
||||
this.smishingNoti = smishingNoti;
|
||||
}
|
||||
|
||||
public float getShortPrice() {
|
||||
return shortPrice;
|
||||
}
|
||||
|
||||
public void setShortPrice(float shortPrice) {
|
||||
this.shortPrice = shortPrice;
|
||||
}
|
||||
|
||||
public float getLongPrice() {
|
||||
return longPrice;
|
||||
}
|
||||
|
||||
public void setLongPrice(float longPrice) {
|
||||
this.longPrice = longPrice;
|
||||
}
|
||||
|
||||
public float getPicturePrice() {
|
||||
return picturePrice;
|
||||
}
|
||||
|
||||
public void setPicturePrice(float picturePrice) {
|
||||
this.picturePrice = picturePrice;
|
||||
}
|
||||
|
||||
public float getPicture2Price() {
|
||||
return picture2Price;
|
||||
}
|
||||
|
||||
public void setPicture2Price(float picture2Price) {
|
||||
this.picture2Price = picture2Price;
|
||||
}
|
||||
|
||||
public float getPicture3Price() {
|
||||
return picture3Price;
|
||||
}
|
||||
|
||||
public void setPicture3Price(float picture3Price) {
|
||||
this.picture3Price = picture3Price;
|
||||
}
|
||||
|
||||
public float getCustomSamplePrice() {
|
||||
return customSamplePrice;
|
||||
}
|
||||
|
||||
public void setCustomSamplePrice(float customSamplePrice) {
|
||||
this.customSamplePrice = customSamplePrice;
|
||||
}
|
||||
|
||||
public float getCustomEditPrice() {
|
||||
return customEditPrice;
|
||||
}
|
||||
|
||||
public void setCustomEditPrice(float customEditPrice) {
|
||||
this.customEditPrice = customEditPrice;
|
||||
}
|
||||
|
||||
public float getCustomEdit3Price() {
|
||||
return customEdit3Price;
|
||||
}
|
||||
|
||||
public void setCustomEdit3Price(float customEdit3Price) {
|
||||
this.customEdit3Price = customEdit3Price;
|
||||
}
|
||||
|
||||
public float getCustomTextPrice() {
|
||||
return customTextPrice;
|
||||
}
|
||||
|
||||
public void setCustomTextPrice(float customTextPrice) {
|
||||
this.customTextPrice = customTextPrice;
|
||||
}
|
||||
|
||||
public float getRefundPer() {
|
||||
return refundPer;
|
||||
}
|
||||
|
||||
public void setRefundPer(float refundPer) {
|
||||
this.refundPer = refundPer;
|
||||
}
|
||||
|
||||
public float getJoinCash() {
|
||||
return joinCash;
|
||||
}
|
||||
|
||||
public void setJoinCash(float joinCash) {
|
||||
this.joinCash = joinCash;
|
||||
}
|
||||
|
||||
public float getPointPer() {
|
||||
return pointPer;
|
||||
}
|
||||
|
||||
public void setPointPer(float pointPer) {
|
||||
this.pointPer = pointPer;
|
||||
}
|
||||
|
||||
public String getLasUpdusrId() {
|
||||
return lasUpdusrId;
|
||||
}
|
||||
|
||||
public void setLasUpdusrId(String lasUpdusrId) {
|
||||
this.lasUpdusrId = lasUpdusrId;
|
||||
}
|
||||
|
||||
public String getLastUpdtPnttm() {
|
||||
return lastUpdtPnttm;
|
||||
}
|
||||
|
||||
public void setLastUpdtPnttm(String lastUpdtPnttm) {
|
||||
this.lastUpdtPnttm = lastUpdtPnttm;
|
||||
}
|
||||
|
||||
public String getJoinCertType() {
|
||||
return joinCertType;
|
||||
}
|
||||
|
||||
public void setJoinCertType(String joinCertType) {
|
||||
this.joinCertType = joinCertType;
|
||||
}
|
||||
|
||||
public String getSmsNoti() {
|
||||
return smsNoti;
|
||||
}
|
||||
|
||||
public void setSmsNoti(String smsNoti) {
|
||||
this.smsNoti = smsNoti;
|
||||
}
|
||||
|
||||
public String getEmailNoti() {
|
||||
return emailNoti;
|
||||
}
|
||||
|
||||
public void setEmailNoti(String emailNoti) {
|
||||
this.emailNoti = emailNoti;
|
||||
}
|
||||
|
||||
public String getSlackNoti() {
|
||||
return slackNoti;
|
||||
}
|
||||
|
||||
public void setSlackNoti(String slackNoti) {
|
||||
this.slackNoti = slackNoti;
|
||||
}
|
||||
|
||||
public float getKakaoAtPrice() {
|
||||
return kakaoAtPrice;
|
||||
}
|
||||
|
||||
public void setKakaoAtPrice(float kakaoAtPrice) {
|
||||
this.kakaoAtPrice = kakaoAtPrice;
|
||||
}
|
||||
|
||||
public float getKakaoFtPrice() {
|
||||
return kakaoFtPrice;
|
||||
}
|
||||
|
||||
public void setKakaoFtPrice(float kakaoFtPrice) {
|
||||
this.kakaoFtPrice = kakaoFtPrice;
|
||||
}
|
||||
|
||||
public float getFaxPrice() {
|
||||
return faxPrice;
|
||||
}
|
||||
|
||||
public void setFaxPrice(float faxPrice) {
|
||||
this.faxPrice = faxPrice;
|
||||
}
|
||||
|
||||
public String getHoliSmishingNoti() {
|
||||
return holiSmishingNoti;
|
||||
}
|
||||
|
||||
public void setHoliSmishingNoti(String holiSmishingNoti) {
|
||||
this.holiSmishingNoti = holiSmishingNoti;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -66,7 +66,6 @@ import itn.let.sym.site.service.SiteManagerVO;
|
||||
import itn.let.sym.site.service.TermsVO;
|
||||
import itn.let.uss.umt.service.EgovUserManageService;
|
||||
import itn.let.uss.umt.service.UserManageVO;
|
||||
import itn.let.utl.user.service.IndexNowUtil;
|
||||
import itn.let.utl.user.service.MjonNoticeSendUtil;
|
||||
|
||||
/**
|
||||
@ -131,9 +130,6 @@ public class EgovSiteManagerController {
|
||||
@Resource(name = "userManageService")
|
||||
private EgovUserManageService userManageService;
|
||||
|
||||
@Resource(name="indexNowUtil")
|
||||
private IndexNowUtil indexNowUtil;
|
||||
|
||||
/** 알림전송 Util */
|
||||
@Resource(name = "mjonNoticeSendUtil")
|
||||
private MjonNoticeSendUtil mjonNoticeSendUtil;
|
||||
@ -2067,55 +2063,6 @@ public class EgovSiteManagerController {
|
||||
return "redirect:/sym/site/selectMetaTagList.do";
|
||||
}
|
||||
|
||||
/**
|
||||
* 메타태그 인택스
|
||||
*
|
||||
* @param metaTagVO
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/sym/site/selectMetaTagIndex.do")
|
||||
public String selectMetaTagIndex(@ModelAttribute("searchVO") MetaTagVO metaTagVO, ModelMap model) throws Exception{
|
||||
|
||||
/** paging */
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(1);
|
||||
paginationInfo.setRecordCountPerPage(100000);
|
||||
paginationInfo.setPageSize(1);
|
||||
|
||||
metaTagVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
metaTagVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
metaTagVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
if("".equals(metaTagVO.getSearchSortCnd())){ //최초조회시 최신것 조회List
|
||||
metaTagVO.setSearchSortCnd("frstRegistPnttm");
|
||||
metaTagVO.setSearchSortOrd("desc");
|
||||
}
|
||||
|
||||
metaTagVO.setSearchKeyword("10");
|
||||
metaTagVO.setSearchCondition("10");
|
||||
|
||||
List<MetaTagVO> metaTagList = egovSiteManagerService.selectMetaTagList(metaTagVO);
|
||||
/*
|
||||
model.addAttribute("metaTagList", metaTagList);
|
||||
paginationInfo.setTotalRecordCount( metaTagList.size()> 0 ? metaTagList.get(0).getTotCnt() : 0);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
*/
|
||||
|
||||
for (int i=0;i<metaTagList.size();i++) {
|
||||
indexNowUtil.submitUrl("https://www.munjaon.co.kr" + metaTagList.get(i).getUrl());
|
||||
//if (i>2) break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//submitUrl("https://yourdomain.com/new-post.html"); // 🔁 여기에 전송할 실제 URL 입력
|
||||
|
||||
//return "/sym/site/metaTagList";
|
||||
return "redirect:/sym/site/selectMetaTagList.do";
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 알림 여부
|
||||
*
|
||||
|
||||
@ -121,4 +121,5 @@ public interface EgovLoginService {
|
||||
//비밀번호 실패 횟수 조회
|
||||
public LoginVO selectPassMiss(LoginVO vo) throws Exception;
|
||||
|
||||
public KmcVO kmcDecryption(HttpServletRequest request, KmcVO kmcVO);
|
||||
}
|
||||
|
||||
@ -17,7 +17,6 @@ import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
import itn.com.cmm.LoginVO;
|
||||
import itn.let.mjo.pay.service.KmcVO;
|
||||
import itn.let.uat.uia.service.AuthCertVO;
|
||||
import itn.let.uat.uia.service.EgovLoginService;
|
||||
import itn.let.uss.umt.service.UserManageVO;
|
||||
import itn.let.utl.fcc.service.EgovNumberUtil;
|
||||
@ -319,6 +318,240 @@ public class EgovLoginServiceImpl extends EgovAbstractServiceImpl implements
|
||||
return loginDAO.selectPassMiss(vo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public KmcVO kmcDecryption(HttpServletRequest request, KmcVO kmcVO) {
|
||||
|
||||
|
||||
|
||||
String rec_cert = request.getParameter("rec_cert").trim();
|
||||
String certNum = request.getParameter("certNum").trim();
|
||||
|
||||
kmcVO.setRecCert(rec_cert);
|
||||
kmcVO.setCertNum(certNum);
|
||||
// 파라미터 유효성 검증
|
||||
if (rec_cert.length() == 0 || certNum.length() == 0) {
|
||||
kmcVO.setErrMessage("비정상");
|
||||
return kmcVO;
|
||||
}
|
||||
// 변수선언
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
String k_certNum = ""; // 파라미터로 수신한 요청번호
|
||||
k_certNum = certNum;
|
||||
String date = ""; // 요청일시
|
||||
String CI = ""; // 연계정보(CI)
|
||||
String DI = ""; // 중복가입확인정보(DI)
|
||||
String phoneNo = ""; // 휴대폰번호
|
||||
String phoneCorp = ""; // 이동통신사
|
||||
String birthDay = ""; // 생년월일
|
||||
String gender = ""; // 성별
|
||||
String nation = ""; // 내국인
|
||||
String name = ""; // 성명
|
||||
String M_name = ""; // 미성년자 성명
|
||||
String M_birthDay = ""; // 미성년자 생년월일
|
||||
String M_Gender = ""; // 미성년자 성별
|
||||
String M_nation = ""; // 미성년자 내외국인
|
||||
String result = ""; // 결과값
|
||||
|
||||
String certMet = ""; // 인증방법
|
||||
String ip = ""; // ip주소
|
||||
String plusInfo = "";
|
||||
|
||||
String encPara = "";
|
||||
String encMsg1 = "";
|
||||
String encMsg2 = "";
|
||||
String msgChk = "";
|
||||
|
||||
IcertSecuManager seed = new IcertSecuManager();
|
||||
|
||||
// 02. 1차 복호화
|
||||
// 수신된 certNum를 이용하여 복호화
|
||||
rec_cert = seed.getDec(rec_cert, k_certNum);
|
||||
|
||||
// 03. 1차 파싱
|
||||
int inf1 = rec_cert.indexOf("/", 0);
|
||||
int inf2 = rec_cert.indexOf("/", inf1 + 1);
|
||||
|
||||
encPara = rec_cert.substring(0, inf1); // 암호화된 통합 파라미터
|
||||
encMsg1 = rec_cert.substring(inf1 + 1, inf2); // 암호화된 통합 파라미터의 Hash값
|
||||
|
||||
// 04. 위변조 검증
|
||||
encMsg2 = seed.getMsg(encPara);
|
||||
kmcVO.setEncMsg2(encMsg2);
|
||||
if (encMsg2.equals(encMsg1)) {
|
||||
msgChk = "Y";
|
||||
}
|
||||
|
||||
if (!"Y".equals(msgChk)) {
|
||||
kmcVO.setErrMessage("비정상접근입니다.");
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
// 05. 2차 복호화
|
||||
rec_cert = seed.getDec(encPara, k_certNum);
|
||||
kmcVO.setRecCert(rec_cert);
|
||||
// 06. 2차 파싱
|
||||
int info1 = rec_cert.indexOf("/", 0);
|
||||
int info2 = rec_cert.indexOf("/", info1 + 1);
|
||||
int info3 = rec_cert.indexOf("/", info2 + 1);
|
||||
int info4 = rec_cert.indexOf("/", info3 + 1);
|
||||
int info5 = rec_cert.indexOf("/", info4 + 1);
|
||||
int info6 = rec_cert.indexOf("/", info5 + 1);
|
||||
int info7 = rec_cert.indexOf("/", info6 + 1);
|
||||
int info8 = rec_cert.indexOf("/", info7 + 1);
|
||||
int info9 = rec_cert.indexOf("/", info8 + 1);
|
||||
int info10 = rec_cert.indexOf("/", info9 + 1);
|
||||
int info11 = rec_cert.indexOf("/", info10 + 1);
|
||||
int info12 = rec_cert.indexOf("/", info11 + 1);
|
||||
int info13 = rec_cert.indexOf("/", info12 + 1);
|
||||
int info14 = rec_cert.indexOf("/", info13 + 1);
|
||||
int info15 = rec_cert.indexOf("/", info14 + 1);
|
||||
int info16 = rec_cert.indexOf("/", info15 + 1);
|
||||
int info17 = rec_cert.indexOf("/", info16 + 1);
|
||||
int info18 = rec_cert.indexOf("/", info17 + 1);
|
||||
|
||||
certNum = rec_cert.substring(0, info1);
|
||||
kmcVO.setCertNum(certNum);
|
||||
date = rec_cert.substring(info1 + 1, info2);
|
||||
kmcVO.setDate(date);
|
||||
CI = rec_cert.substring(info2 + 1, info3);
|
||||
kmcVO.setCI(CI);
|
||||
phoneNo = rec_cert.substring(info3 + 1, info4);
|
||||
kmcVO.setPhoneNo(phoneNo);
|
||||
phoneCorp = rec_cert.substring(info4 + 1, info5);
|
||||
kmcVO.setPhoneCorp(phoneCorp);
|
||||
birthDay = rec_cert.substring(info5 + 1, info6);
|
||||
kmcVO.setBirthDay(birthDay);
|
||||
gender = rec_cert.substring(info6 + 1, info7);
|
||||
kmcVO.setGender(gender);
|
||||
nation = rec_cert.substring(info7 + 1, info8);
|
||||
kmcVO.setNation(nation);
|
||||
name = rec_cert.substring(info8 + 1, info9);
|
||||
kmcVO.setName(name);
|
||||
result = rec_cert.substring(info9 + 1, info10);
|
||||
kmcVO.setResult(result);
|
||||
certMet = rec_cert.substring(info10 + 1, info11);
|
||||
kmcVO.setCertMet(certMet);
|
||||
ip = rec_cert.substring(info11 + 1, info12);
|
||||
kmcVO.setIp(ip);
|
||||
M_name = rec_cert.substring(info12 + 1, info13);
|
||||
kmcVO.setMName(M_name);
|
||||
M_birthDay = rec_cert.substring(info13 + 1, info14);
|
||||
kmcVO.setMBirthDay(M_birthDay);
|
||||
M_Gender = rec_cert.substring(info14 + 1, info15);
|
||||
kmcVO.setMGender(M_Gender);
|
||||
M_nation = rec_cert.substring(info15 + 1, info16);
|
||||
kmcVO.setMNation(M_nation);
|
||||
plusInfo = rec_cert.substring(info16 + 1, info17);
|
||||
kmcVO.setPlusInfo(plusInfo);
|
||||
DI = rec_cert.substring(info17 + 1, info18);
|
||||
kmcVO.setDI(DI);
|
||||
|
||||
// 07. CI, DI 복호화
|
||||
CI = seed.getDec(CI, k_certNum);
|
||||
kmcVO.setCI(CI);
|
||||
DI = seed.getDec(DI, k_certNum);
|
||||
kmcVO.setDI(DI);
|
||||
|
||||
if ("Y".equals(result)) {
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
String regex = "";
|
||||
if (certNum.length() == 0 || certNum.length() > 40) {
|
||||
kmcVO.setErrMessage("요청번호 비정상.");
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (date.length() != 14 || !this.paramChk(regex, date)) {
|
||||
kmcVO.setErrMessage("요청일시");
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if (certMet.length() != 1 || !this.paramChk(regex, certMet)) {
|
||||
kmcVO.setErrMessage("본인인증방법 비정상" + certMet);
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if ((phoneNo.length() != 10 && phoneNo.length() != 11) || !this.paramChk(regex, phoneNo)) {
|
||||
kmcVO.setErrMessage("휴대폰번호 비정상");
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if (phoneCorp.length() != 3 || !this.paramChk(regex, phoneCorp)) {
|
||||
kmcVO.setErrMessage("이동통신사 비정상");
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (birthDay.length() != 8 || !this.paramChk(regex, birthDay)) {
|
||||
kmcVO.setErrMessage("생년월일 비정상");
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (gender.length() != 1 || !this.paramChk(regex, gender)) {
|
||||
kmcVO.setErrMessage("성별 비정상");
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (nation.length() != 1 || !this.paramChk(regex, nation)) {
|
||||
kmcVO.setErrMessage("내/외국인 비정상");
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-<2D>R.,-]*";
|
||||
if (name.length() > 60 || !this.paramChk(regex, name)) {
|
||||
kmcVO.setErrMessage("성명 비정상");
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if (result.length() != 1 || !this.paramChk(regex, result)) {
|
||||
kmcVO.setErrMessage("결과값 비정상");
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-?.,-]*";
|
||||
if (M_name.length() != 0) {
|
||||
if (M_name.length() > 60 || !this.paramChk(regex, M_name)) {
|
||||
kmcVO.setErrMessage("미성년자 성명 비정상");
|
||||
return kmcVO;
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (M_birthDay.length() != 0) {
|
||||
if (M_birthDay.length() != 8 || !this.paramChk(regex, M_birthDay)) {
|
||||
kmcVO.setErrMessage("미성년자 생년월일 비정상");
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (M_Gender.length() != 0) {
|
||||
if (M_Gender.length() != 1 || !paramChk(regex, M_Gender)) {
|
||||
kmcVO.setErrMessage("미성년자 성별 비정상");
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (M_nation.length() != 0) {
|
||||
if (M_nation.length() != 1 || !this.paramChk(regex, M_nation)) {
|
||||
kmcVO.setErrMessage("미성년자 내/외국인 비정상");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return kmcVO;
|
||||
}
|
||||
|
||||
|
||||
public Boolean paramChk(String patn, String param) {
|
||||
Pattern pattern = Pattern.compile(patn);
|
||||
Matcher matcher = pattern.matcher(param);
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
package itn.let.uat.uia.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -16,16 +11,14 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import itn.com.cmm.util.StringUtil;
|
||||
import itn.com.uss.olh.hpc.service.HackIpService;
|
||||
import itn.com.uss.olh.hpc.service.HackIpVO;
|
||||
import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.mjo.msgdata.service.MjonMsgDataService;
|
||||
import itn.let.mjo.cert.service.CertVO;
|
||||
import itn.let.mjo.msgsent.service.MjonMsgSentVO;
|
||||
import itn.let.mjo.pay.service.KmcVO;
|
||||
import itn.let.sec.rgm.service.AuthorGroup;
|
||||
import itn.let.sec.rgm.service.EgovAuthorGroupService;
|
||||
import itn.let.sym.site.service.JoinSettingVO;
|
||||
import itn.let.uat.uia.service.AuthCertVO;
|
||||
import itn.let.uss.umt.service.AdmProcHstryVO;
|
||||
import itn.let.uss.umt.service.EgovMberManageService;
|
||||
@ -89,10 +82,6 @@ public class EgovMberManageServiceImpl extends EgovAbstractServiceImpl implement
|
||||
@Resource(name = "hackIpService")
|
||||
private HackIpService hackIpService;
|
||||
|
||||
/* MjonMsgDataService */
|
||||
@Resource(name = "MjonMsgDataService")
|
||||
private MjonMsgDataService mjonMsgDataService;
|
||||
|
||||
|
||||
@Override
|
||||
public int insertMber(MberManageVO mberManageVO) throws Exception {
|
||||
@ -632,71 +621,4 @@ public class EgovMberManageServiceImpl extends EgovAbstractServiceImpl implement
|
||||
return mberManageDAO.findTopByregDateFromCertLog(authCertVO);
|
||||
}
|
||||
|
||||
public MberManageVO selectMberHeaderInfo(String mberId) throws Exception {
|
||||
//회원 단가, 이벤트 단가, 이벤트 종료일 등 조회
|
||||
MberManageVO headerInfo = mberManageDAO.selectMberHeaderInfo(mberId);
|
||||
//기본 단가 조회
|
||||
JoinSettingVO sysPrice = mjonMsgDataService.selectJoinSettingInfo();
|
||||
|
||||
//이벤트 종료까지 남은 일 수 계산
|
||||
long eventLeftDay = calculateEventLeftDay(headerInfo.getEventEndDate());
|
||||
headerInfo.setEventLeftDay(String.valueOf(eventLeftDay));
|
||||
|
||||
//이벤트 유무에 따라 이벤트 잔액 or 잔액 사용
|
||||
boolean isEventActive = eventLeftDay > 0;
|
||||
double money = isEventActive ? headerInfo.getEventRemainCash() : headerInfo.getUserMoney();
|
||||
|
||||
//이벤트, 회원 단가가 0일 시 기본 단가 사용
|
||||
setPrices(headerInfo, sysPrice, isEventActive);
|
||||
|
||||
//발송가능 건수 조회
|
||||
calculateAvailableCounts(headerInfo, money);
|
||||
|
||||
return headerInfo;
|
||||
}
|
||||
|
||||
private long calculateEventLeftDay(String eventEndDateStr) {
|
||||
if (StringUtil.isEmpty(eventEndDateStr)) return 0;
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDate eventEndDate = LocalDate.parse(eventEndDateStr, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
return ChronoUnit.DAYS.between(today, eventEndDate);
|
||||
}
|
||||
|
||||
private void setPrices(MberManageVO headerInfo, JoinSettingVO sysPrice, boolean isEventActive) {
|
||||
if (isEventActive) {
|
||||
headerInfo.setHeaderShortPrice(priceChk(headerInfo.getEventShortPrice(), sysPrice.getShortPrice()));
|
||||
headerInfo.setHeaderLongPrice(priceChk(headerInfo.getEventLongPrice(), sysPrice.getLongPrice()));
|
||||
headerInfo.setHeaderPicturePrice(priceChk(headerInfo.getEventPicturePrice(), sysPrice.getPicturePrice()));
|
||||
headerInfo.setHeaderPicture2Price(priceChk(headerInfo.getEventPicture2Price(), sysPrice.getPicture2Price()));
|
||||
headerInfo.setHeaderPicture3Price(priceChk(headerInfo.getEventPicture3Price(), sysPrice.getPicture3Price()));
|
||||
} else {
|
||||
headerInfo.setHeaderShortPrice(priceChk(headerInfo.getShortPrice(), sysPrice.getShortPrice()));
|
||||
headerInfo.setHeaderLongPrice(priceChk(headerInfo.getLongPrice(), sysPrice.getLongPrice()));
|
||||
headerInfo.setHeaderPicturePrice(priceChk(headerInfo.getPicturePrice(), sysPrice.getPicturePrice()));
|
||||
headerInfo.setHeaderPicture2Price(priceChk(headerInfo.getPicture2Price(), sysPrice.getPicture2Price()));
|
||||
headerInfo.setHeaderPicture3Price(priceChk(headerInfo.getPicture3Price(), sysPrice.getPicture3Price()));
|
||||
}
|
||||
// 카카오, 팩스 단가는 기본 단가 고정
|
||||
headerInfo.setHeaderKakaoAtPrice(sysPrice.getKakaoAtPrice());
|
||||
headerInfo.setHeaderFaxPrice(sysPrice.getFaxPrice());
|
||||
}
|
||||
|
||||
private float priceChk(float price, float sysPrice) {
|
||||
return price > 0 ? price : sysPrice;
|
||||
}
|
||||
|
||||
private void calculateAvailableCounts(MberManageVO headerInfo, double money) {
|
||||
headerInfo.setHeaderShortCnt(calcCount(money, headerInfo.getHeaderShortPrice()));
|
||||
headerInfo.setHeaderLongCnt(calcCount(money, headerInfo.getHeaderLongPrice()));
|
||||
headerInfo.setHeaderPictureCnt(calcCount(money, headerInfo.getHeaderPicturePrice()));
|
||||
headerInfo.setHeaderPicture2Cnt(calcCount(money, headerInfo.getHeaderPicture2Price()));
|
||||
headerInfo.setHeaderPicture3Cnt(calcCount(money, headerInfo.getHeaderPicture3Price()));
|
||||
headerInfo.setHeaderKakaoAtCnt(calcCount(money, headerInfo.getHeaderKakaoAtPrice()));
|
||||
headerInfo.setHeaderFaxCnt(calcCount(money, headerInfo.getHeaderFaxPrice()));
|
||||
}
|
||||
|
||||
private int calcCount(double money, double price) {
|
||||
if (price <= 0) return 0;
|
||||
return (int) Math.floor(money / price);
|
||||
}
|
||||
}
|
||||
@ -346,7 +346,4 @@ public class MberManageDAO extends EgovComAbstractDAO{
|
||||
return (String)select("mberManageDAO.findTopByregDateFromCertLog", authCertVO);
|
||||
}
|
||||
|
||||
public MberManageVO selectMberHeaderInfo(String mberId) {
|
||||
return (MberManageVO) select("mberManageDAO.selectMberHeaderInfo", mberId);
|
||||
}
|
||||
}
|
||||
@ -252,10 +252,6 @@ public class EgovLoginController {
|
||||
@Resource(name = "CertIpService")
|
||||
private CertIpService certIpService;
|
||||
|
||||
@Resource(name = "KmcCertChecker")
|
||||
private KmcCertChecker kmcCertChecker;
|
||||
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(MjonMsgDataController.class);
|
||||
|
||||
/* 문자온 사용자 로그인 시작 */
|
||||
@ -323,20 +319,20 @@ public class EgovLoginController {
|
||||
// 핸드폰인증만 사용할 시
|
||||
if (joinSettingVO.getJoinCertType().equals("M")) {
|
||||
|
||||
// KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
//
|
||||
// String serverNm = request.getScheme() + "://" + request.getServerName();
|
||||
// if(request.getServerPort() != 80
|
||||
// && request.getServerPort() != 443) {
|
||||
// serverNm += ":" + request.getServerPort();
|
||||
// }
|
||||
//
|
||||
// AuthCertVO certVO = kmcCertCheck.authCertCheck(serverNm + "/web/cop/kmc/authRequestAjax.do");
|
||||
//
|
||||
KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
|
||||
MberCertPhoneVO mberCertPhoneVO = new MberCertPhoneVO();
|
||||
mberCertPhoneVO.setTrUrl("/web/cop/kmc/authRequestAjax.do");
|
||||
AuthCertVO certVO = kmcCertChecker.authCertCheck(mberCertPhoneVO, request);
|
||||
// kmc 본인인증 실/개발 서버 구분
|
||||
String serverNm = "";
|
||||
if (request.getServerName().contains("219.240.88.15") || request.getServerName().contains("localhost")) {
|
||||
serverNm = request.getScheme() + "://219.240.88.15:8095";
|
||||
}else if(request.getRequestURL().toString().contains("www.")){
|
||||
serverNm = request.getScheme() + "://www.munjaon.co.kr";
|
||||
}
|
||||
else {
|
||||
serverNm = request.getScheme() + "://munjaon.co.kr";
|
||||
}
|
||||
|
||||
AuthCertVO certVO = kmcCertCheck.authCertCheck(serverNm + "/web/cop/kmc/authRequestAjax.do");
|
||||
|
||||
model.addAttribute("tr_cert", certVO.getTr_cert());
|
||||
model.addAttribute("tr_url", certVO.getTr_url());
|
||||
@ -367,29 +363,19 @@ public class EgovLoginController {
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
// KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
|
||||
// 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";
|
||||
// }
|
||||
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/authRequestAjax.do");
|
||||
mberCertPhoneVO.setName(mberManageVO.getMberNm());
|
||||
mberCertPhoneVO.setPhoneNo(mberManageVO.getMoblphonNo());
|
||||
mberCertPhoneVO.setGender(mberManageVO.getSexdstnCode());
|
||||
mberCertPhoneVO.setNation(mberManageVO.getNationality());
|
||||
mberCertPhoneVO.setBirthDay(mberManageVO.getBirth());
|
||||
|
||||
AuthCertVO certVO = kmcCertChecker.authCertCheck(mberCertPhoneVO, request);
|
||||
|
||||
// AuthCertVO certVO = kmcCertCheck.authCertCheckTwo(serverNm + "/web/cop/kmc/authRequestAjax.do",
|
||||
// mberManageVO.getMberNm(), mberManageVO.getMoblphonNo(), mberManageVO.getSexdstnCode(),
|
||||
// mberManageVO.getNationality(), mberManageVO.getBirth());
|
||||
AuthCertVO certVO = kmcCertCheck.authCertCheckTwo(serverNm + "/web/cop/kmc/authRequestAjax.do",
|
||||
mberManageVO.getMberNm(), mberManageVO.getMoblphonNo(), mberManageVO.getSexdstnCode(),
|
||||
mberManageVO.getNationality(), mberManageVO.getBirth());
|
||||
|
||||
System.out.println("++++++++++++ 세션체크222 ::: " + (MberManageVO) session.getAttribute("mberSession"));
|
||||
|
||||
@ -4005,37 +3991,21 @@ public class EgovLoginController {
|
||||
// modelAndView.addObject("status", "fail");
|
||||
|
||||
try {
|
||||
// KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
//
|
||||
// // mberId null일경우 ""로
|
||||
// mberManageVO.setMberId(EgovStringUtil.isNullToString(mberManageVO.getMberId()));
|
||||
//
|
||||
// // kmc 본인인증 실/개발 서버 구분
|
||||
// String serverNm = "";
|
||||
// if (request.getServerName().contains("119.193.215.98") || request.getServerName().contains("localhost")) {
|
||||
// serverNm = request.getScheme() + "://119.193.215.98:8095";
|
||||
// } else {
|
||||
// serverNm = request.getScheme() + "://www.munjaon.co.kr";
|
||||
// }
|
||||
// String authRUrl = serverNm + mberManageVO.getAuthRUrl();
|
||||
//
|
||||
// AuthCertVO certVO = kmcCertCheck.authCertCheckThree(authRUrl, mberManageVO);
|
||||
//
|
||||
//
|
||||
MberCertPhoneVO mberCertPhoneVO = new MberCertPhoneVO();
|
||||
mberCertPhoneVO.setTrUrl("/web/cop/kmc/authRequestFindIdPwAjax.do");
|
||||
mberCertPhoneVO.setName(mberManageVO.getMberNm());
|
||||
mberCertPhoneVO.setPhoneNo(mberManageVO.getMoblphonNo());
|
||||
KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
|
||||
String plusInfo = "";
|
||||
plusInfo += mberManageVO.getMberId();
|
||||
if(StringUtils.isNotEmpty(mberManageVO.getPassword()))
|
||||
{
|
||||
plusInfo = plusInfo + ",,," + mberManageVO.getPassword();
|
||||
// mberId null일경우 ""로
|
||||
mberManageVO.setMberId(EgovStringUtil.isNullToString(mberManageVO.getMberId()));
|
||||
|
||||
// kmc 본인인증 실/개발 서버 구분
|
||||
String serverNm = "";
|
||||
if (request.getServerName().contains("119.193.215.98") || request.getServerName().contains("localhost")) {
|
||||
serverNm = request.getScheme() + "://119.193.215.98:8095";
|
||||
} else {
|
||||
serverNm = request.getScheme() + "://www.munjaon.co.kr";
|
||||
}
|
||||
mberCertPhoneVO.setPlusInfo(plusInfo);
|
||||
String authRUrl = serverNm + mberManageVO.getAuthRUrl();
|
||||
|
||||
AuthCertVO certVO = kmcCertChecker.authCertCheck(mberCertPhoneVO, request);
|
||||
AuthCertVO certVO = kmcCertCheck.authCertCheckThree(authRUrl, mberManageVO);
|
||||
|
||||
modelAndView.addObject("tr_cert", certVO.getTr_cert());
|
||||
modelAndView.addObject("tr_url", certVO.getTr_url());
|
||||
@ -4060,26 +4030,22 @@ public class EgovLoginController {
|
||||
*/
|
||||
|
||||
@RequestMapping("/web/cop/kmc/authRequestFindIdPwAjax.do")
|
||||
public String authRequestFindIdPwAjax(HttpServletRequest request, HttpServletResponse response, ModelMap model,
|
||||
public String authRequestFindIdPwAjax(HttpServletRequest request, ModelMap model,
|
||||
@RequestParam Map<String, Object> commandMap, @ModelAttribute("searchVO") KmcVO kmcVO,
|
||||
RedirectAttributes redirectAttributes) throws Exception {
|
||||
|
||||
// KmcVO kmcRVO = loginService.kmcDecryption(request, kmcVO);
|
||||
//kmc 본인인증 결과처리
|
||||
kmcVO = kmcCertChecker.authCertResult(request, response, model);
|
||||
//kmc 본인인증 로그 처리
|
||||
AuthCertVO certVO = kmcCertChecker.insertCertLog(kmcVO, "KMC_아이디패스워드찾기");
|
||||
KmcVO kmcRVO = loginService.kmcDecryption(request, kmcVO);
|
||||
|
||||
String msg = "";
|
||||
if (!findIdKmcCheck(kmcVO.getDI(), kmcVO.getName(), kmcVO.getPhoneNo())) {
|
||||
if (!findIdKmcCheck(kmcRVO.getDI(), kmcRVO.getName(), kmcRVO.getPhoneNo())) {
|
||||
msg = "일치하는 정보가 없습니다.";
|
||||
redirectAttributes.addFlashAttribute("message", msg);
|
||||
return "redirect:/web/user/findUserId.do";
|
||||
}
|
||||
|
||||
// kmcRVO.setCertType("KMC_아이디패스워드찾기");
|
||||
// // 디비 테이블에 저장하기
|
||||
// mberManageService.insertCertInfoLogBn(kmcRVO);
|
||||
kmcRVO.setCertType("KMC_아이디패스워드찾기");
|
||||
// 디비 테이블에 저장하기
|
||||
mberManageService.insertCertInfoLogBn(kmcRVO);
|
||||
|
||||
model.addAttribute("kmcVO", kmcVO);
|
||||
return "web/login/findUserIdKmcReqPage";
|
||||
@ -4096,24 +4062,18 @@ public class EgovLoginController {
|
||||
* @discription 관리자 로그인 DN 값 최초 등록
|
||||
*/
|
||||
@RequestMapping("/web/cop/kmc/authRequestSelfLoginAjax.do")
|
||||
public String authRequestSelfLoginAjax(HttpServletRequest request, HttpServletResponse response, ModelMap model,
|
||||
public String authRequestSelfLoginAjax(HttpServletRequest request, ModelMap model,
|
||||
@RequestParam Map<String, Object> commandMap, @ModelAttribute("searchVO") KmcVO kmcVO,
|
||||
RedirectAttributes redirectAttributes, HttpSession session) throws Exception {
|
||||
|
||||
UserManageVO userManageVO = new UserManageVO();
|
||||
|
||||
// KmcVO kmcRVO = loginService.kmcDecryption(request, kmcVO);
|
||||
KmcVO kmcRVO = loginService.kmcDecryption(request, kmcVO);
|
||||
|
||||
//kmc 본인인증 결과처리
|
||||
kmcVO = kmcCertChecker.authCertResult(request, response, model);
|
||||
//kmc 본인인증 로그 처리
|
||||
AuthCertVO certVO = kmcCertChecker.insertCertLog(kmcVO, "KMC_아이디패스워드찾기");
|
||||
|
||||
|
||||
userManageVO.setCrtfcDnValue(kmcVO.getDI());
|
||||
userManageVO.setEmplyrNm(kmcVO.getName());
|
||||
userManageVO.setEmplyrId(kmcVO.getPlusInfo().split(",,,")[0]);
|
||||
userManageVO.setPassword(kmcVO.getPlusInfo().split(",,,")[1]);
|
||||
userManageVO.setCrtfcDnValue(kmcRVO.getDI());
|
||||
userManageVO.setEmplyrNm(kmcRVO.getName());
|
||||
userManageVO.setEmplyrId(kmcRVO.getPlusInfo().split(",,,")[0]);
|
||||
userManageVO.setPassword(kmcRVO.getPlusInfo().split(",,,")[1]);
|
||||
|
||||
userManageService.updateCrtfcDnValue(userManageVO);
|
||||
|
||||
@ -4131,20 +4091,20 @@ public class EgovLoginController {
|
||||
e.printStackTrace();
|
||||
// TODO: handle exception
|
||||
}
|
||||
// kmcRVO.setCertType("KMC_관리자미인증IP접속인증");
|
||||
// // 디비 테이블에 저장하기
|
||||
//
|
||||
// try {
|
||||
// mberManageService.insertCertInfoLogBn(kmcRVO);
|
||||
//
|
||||
// } catch (Exception e) {
|
||||
// System.out.println("!!!!!!!!!!!!!!!!!");
|
||||
// e.printStackTrace();
|
||||
// // TODO: handle exception
|
||||
// }
|
||||
kmcRVO.setCertType("KMC_관리자미인증IP접속인증");
|
||||
// 디비 테이블에 저장하기
|
||||
|
||||
try {
|
||||
mberManageService.insertCertInfoLogBn(kmcRVO);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("!!!!!!!!!!!!!!!!!");
|
||||
e.printStackTrace();
|
||||
// TODO: handle exception
|
||||
}
|
||||
|
||||
|
||||
model.addAttribute("kmcVO", kmcVO);
|
||||
model.addAttribute("kmcVO", kmcRVO);
|
||||
|
||||
System.out.println("======================================");
|
||||
model.addAttribute("userManageVO", userManageVO);
|
||||
@ -5426,16 +5386,28 @@ public class EgovLoginController {
|
||||
// 팝업에 넣을 이름과 핸드폰번호 조회
|
||||
LoginVO KMCInfoVO = loginService.selectKMCInfo(loginVO);
|
||||
|
||||
MberCertPhoneVO mberCertPhoneVO = new MberCertPhoneVO();
|
||||
mberCertPhoneVO.setTrUrl("/web/cop/kmc/insertIPAjax.do");
|
||||
mberCertPhoneVO.setName("c".equals(KMCInfoVO.getDept()) ? KMCInfoVO.getManagerNm() : KMCInfoVO.getMberNm());
|
||||
mberCertPhoneVO.setBirthDay(KMCInfoVO.getBirth());
|
||||
mberCertPhoneVO.setPhoneNo(KMCInfoVO.getMoblphonNo());
|
||||
mberCertPhoneVO.setGender(KMCInfoVO.getSexdstnCode());
|
||||
mberCertPhoneVO.setNation(KMCInfoVO.getNationality());
|
||||
mberCertPhoneVO.setPlusInfo(loginVO.getId());
|
||||
// KMC 팝업 오픈 준비
|
||||
KmcCertChecker kmcCertCheck = new KmcCertChecker();
|
||||
String mberNm = KMCInfoVO.getMberNm();
|
||||
if ("c".equals(KMCInfoVO.getDept())) {
|
||||
mberNm = KMCInfoVO.getManagerNm();
|
||||
}
|
||||
String birth = KMCInfoVO.getBirth();
|
||||
String moblphonNo = KMCInfoVO.getMoblphonNo();
|
||||
String sexdstnCode = KMCInfoVO.getSexdstnCode();
|
||||
String nationality = KMCInfoVO.getNationality();
|
||||
String id = loginVO.getId();
|
||||
|
||||
AuthCertVO certVO = kmcCertChecker.authCertCheck(mberCertPhoneVO, request);
|
||||
// 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.authCertCheckFour(serverNm + "/web/cop/kmc/insertIPAjax.do", mberNm,
|
||||
moblphonNo, sexdstnCode, nationality, birth, id);
|
||||
|
||||
modelAndView.addObject("tr_cert", certVO.getTr_cert());
|
||||
modelAndView.addObject("tr_url", certVO.getTr_url());
|
||||
@ -5456,19 +5428,245 @@ public class EgovLoginController {
|
||||
*
|
||||
*/
|
||||
@RequestMapping("/web/cop/kmc/insertIPAjax.do")
|
||||
public String insertIPAjax(HttpServletRequest request, HttpServletResponse response, ModelMap model, @RequestParam Map<String, Object> commandMap,
|
||||
public String insertIPAjax(HttpServletRequest request, ModelMap model, @RequestParam Map<String, Object> commandMap,
|
||||
@ModelAttribute("searchVO") KmcVO kmcVO) throws Exception {
|
||||
|
||||
//kmc 본인인증 결과처리
|
||||
kmcVO = kmcCertChecker.authCertResult(request, response, model);
|
||||
//kmc 본인인증 로그 처리
|
||||
AuthCertVO certVO = kmcCertChecker.insertCertLog(kmcVO, "IP등록");
|
||||
String errMessage = ""; // 에러메세지
|
||||
|
||||
String rec_cert = ""; // 결과값(암호화)
|
||||
String certNum = ""; // certNum
|
||||
|
||||
rec_cert = request.getParameter("rec_cert").trim();
|
||||
certNum = request.getParameter("certNum").trim();
|
||||
|
||||
kmcVO.setRecCert(rec_cert);
|
||||
kmcVO.setCertNum(certNum);
|
||||
// 파라미터 유효성 검증
|
||||
if (rec_cert.length() == 0 || certNum.length() == 0) {
|
||||
errMessage = "비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
// 변수선언
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
String k_certNum = ""; // 파라미터로 수신한 요청번호
|
||||
k_certNum = certNum;
|
||||
String date = ""; // 요청일시
|
||||
String CI = ""; // 연계정보(CI)
|
||||
String DI = ""; // 중복가입확인정보(DI)
|
||||
String phoneNo = ""; // 휴대폰번호
|
||||
String phoneCorp = ""; // 이동통신사
|
||||
String birthDay = ""; // 생년월일
|
||||
String gender = ""; // 성별
|
||||
String nation = ""; // 내국인
|
||||
String name = ""; // 성명
|
||||
String M_name = ""; // 미성년자 성명
|
||||
String M_birthDay = ""; // 미성년자 생년월일
|
||||
String M_Gender = ""; // 미성년자 성별
|
||||
String M_nation = ""; // 미성년자 내외국인
|
||||
String result = ""; // 결과값
|
||||
|
||||
String certMet = ""; // 인증방법
|
||||
String ip = ""; // ip주소
|
||||
String plusInfo = "";
|
||||
|
||||
String encPara = "";
|
||||
String encMsg1 = "";
|
||||
String encMsg2 = "";
|
||||
String msgChk = "";
|
||||
|
||||
com.icert.comm.secu.IcertSecuManager seed = new com.icert.comm.secu.IcertSecuManager();
|
||||
|
||||
// 02. 1차 복호화
|
||||
// 수신된 certNum를 이용하여 복호화
|
||||
rec_cert = seed.getDec(rec_cert, k_certNum);
|
||||
|
||||
// 03. 1차 파싱
|
||||
int inf1 = rec_cert.indexOf("/", 0);
|
||||
int inf2 = rec_cert.indexOf("/", inf1 + 1);
|
||||
|
||||
encPara = rec_cert.substring(0, inf1); // 암호화된 통합 파라미터
|
||||
encMsg1 = rec_cert.substring(inf1 + 1, inf2); // 암호화된 통합 파라미터의 Hash값
|
||||
|
||||
// 04. 위변조 검증
|
||||
encMsg2 = seed.getMsg(encPara);
|
||||
kmcVO.setEncMsg2(encMsg2);
|
||||
if (encMsg2.equals(encMsg1)) {
|
||||
msgChk = "Y";
|
||||
}
|
||||
|
||||
if (!"Y".equals(msgChk)) {
|
||||
errMessage = "비정상접근입니다.";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
// 05. 2차 복호화
|
||||
rec_cert = seed.getDec(encPara, k_certNum);
|
||||
kmcVO.setRecCert(rec_cert);
|
||||
// 06. 2차 파싱
|
||||
int info1 = rec_cert.indexOf("/", 0);
|
||||
int info2 = rec_cert.indexOf("/", info1 + 1);
|
||||
int info3 = rec_cert.indexOf("/", info2 + 1);
|
||||
int info4 = rec_cert.indexOf("/", info3 + 1);
|
||||
int info5 = rec_cert.indexOf("/", info4 + 1);
|
||||
int info6 = rec_cert.indexOf("/", info5 + 1);
|
||||
int info7 = rec_cert.indexOf("/", info6 + 1);
|
||||
int info8 = rec_cert.indexOf("/", info7 + 1);
|
||||
int info9 = rec_cert.indexOf("/", info8 + 1);
|
||||
int info10 = rec_cert.indexOf("/", info9 + 1);
|
||||
int info11 = rec_cert.indexOf("/", info10 + 1);
|
||||
int info12 = rec_cert.indexOf("/", info11 + 1);
|
||||
int info13 = rec_cert.indexOf("/", info12 + 1);
|
||||
int info14 = rec_cert.indexOf("/", info13 + 1);
|
||||
int info15 = rec_cert.indexOf("/", info14 + 1);
|
||||
int info16 = rec_cert.indexOf("/", info15 + 1);
|
||||
int info17 = rec_cert.indexOf("/", info16 + 1);
|
||||
int info18 = rec_cert.indexOf("/", info17 + 1);
|
||||
|
||||
certNum = rec_cert.substring(0, info1);
|
||||
kmcVO.setCertNum(certNum);
|
||||
date = rec_cert.substring(info1 + 1, info2);
|
||||
kmcVO.setDate(date);
|
||||
CI = rec_cert.substring(info2 + 1, info3);
|
||||
kmcVO.setCI(CI);
|
||||
phoneNo = rec_cert.substring(info3 + 1, info4);
|
||||
kmcVO.setPhoneNo(phoneNo);
|
||||
phoneCorp = rec_cert.substring(info4 + 1, info5);
|
||||
kmcVO.setPhoneCorp(phoneCorp);
|
||||
birthDay = rec_cert.substring(info5 + 1, info6);
|
||||
kmcVO.setBirthDay(birthDay);
|
||||
gender = rec_cert.substring(info6 + 1, info7);
|
||||
kmcVO.setGender(gender);
|
||||
nation = rec_cert.substring(info7 + 1, info8);
|
||||
kmcVO.setNation(nation);
|
||||
name = rec_cert.substring(info8 + 1, info9);
|
||||
kmcVO.setName(name);
|
||||
result = rec_cert.substring(info9 + 1, info10);
|
||||
kmcVO.setResult(result);
|
||||
certMet = rec_cert.substring(info10 + 1, info11);
|
||||
kmcVO.setCertMet(certMet);
|
||||
ip = rec_cert.substring(info11 + 1, info12);
|
||||
kmcVO.setIp(ip);
|
||||
M_name = rec_cert.substring(info12 + 1, info13);
|
||||
kmcVO.setMName(M_name);
|
||||
M_birthDay = rec_cert.substring(info13 + 1, info14);
|
||||
kmcVO.setMBirthDay(M_birthDay);
|
||||
M_Gender = rec_cert.substring(info14 + 1, info15);
|
||||
kmcVO.setMGender(M_Gender);
|
||||
M_nation = rec_cert.substring(info15 + 1, info16);
|
||||
kmcVO.setMNation(M_nation);
|
||||
plusInfo = rec_cert.substring(info16 + 1, info17);
|
||||
kmcVO.setPlusInfo(plusInfo);
|
||||
DI = rec_cert.substring(info17 + 1, info18);
|
||||
kmcVO.setDI(DI);
|
||||
|
||||
// 07. CI, DI 복호화
|
||||
CI = seed.getDec(CI, k_certNum);
|
||||
kmcVO.setCI(CI);
|
||||
DI = seed.getDec(DI, k_certNum);
|
||||
kmcVO.setDI(DI);
|
||||
|
||||
if ("Y".equals(result)) {
|
||||
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------
|
||||
String regex = "";
|
||||
if (certNum.length() == 0 || certNum.length() > 40) {
|
||||
errMessage = "요청번호 비정상.";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (date.length() != 14 || !paramChk(regex, date)) {
|
||||
errMessage = "요청일시";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if (certMet.length() != 1 || !paramChk(regex, certMet)) {
|
||||
errMessage = "본인인증방법 비정상" + certMet;
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if ((phoneNo.length() != 10 && phoneNo.length() != 11) || !paramChk(regex, phoneNo)) {
|
||||
errMessage = "휴대폰번호 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if (phoneCorp.length() != 3 || !paramChk(regex, phoneCorp)) {
|
||||
errMessage = "이동통신사 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (birthDay.length() != 8 || !paramChk(regex, birthDay)) {
|
||||
errMessage = "생년월일 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (gender.length() != 1 || !paramChk(regex, gender)) {
|
||||
errMessage = "성별 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (nation.length() != 1 || !paramChk(regex, nation)) {
|
||||
errMessage = "내/외국인 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-<2D>R.,-]*";
|
||||
if (name.length() > 60 || !paramChk(regex, name)) {
|
||||
errMessage = "성명 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[A-Z]*";
|
||||
if (result.length() != 1 || !paramChk(regex, result)) {
|
||||
errMessage = "결과값 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
|
||||
regex = "[\\sA-Za-z가-?.,-]*";
|
||||
if (M_name.length() != 0) {
|
||||
if (M_name.length() > 60 || !paramChk(regex, M_name)) {
|
||||
errMessage = "미성년자 성명 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (M_birthDay.length() != 0) {
|
||||
if (M_birthDay.length() != 8 || !paramChk(regex, M_birthDay)) {
|
||||
errMessage = "미성년자 생년월일 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (M_Gender.length() != 0) {
|
||||
if (M_Gender.length() != 1 || !paramChk(regex, M_Gender)) {
|
||||
errMessage = "미성년자 성별 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
}
|
||||
|
||||
regex = "[0-9]*";
|
||||
if (M_nation.length() != 0) {
|
||||
if (M_nation.length() != 1 || !paramChk(regex, M_nation)) {
|
||||
errMessage = "미성년자 내/외국인 비정상";
|
||||
return returnPage(model, errMessage, kmcVO);
|
||||
}
|
||||
}
|
||||
LoginVO loginVO = new LoginVO();
|
||||
loginVO.setId(kmcVO.getPlusInfo());
|
||||
|
||||
loginVO.setId(plusInfo);
|
||||
loginVO = loginService.selectKMCInfo(loginVO);
|
||||
loginVO.setIp(kmcVO.getIp());
|
||||
String userIp = EgovClntInfo.getClntIP(request);
|
||||
loginVO.setIp(ip);
|
||||
|
||||
loginService.insertMberIp(loginVO);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -198,7 +198,7 @@ public class EgovMypageRESTAPIController{
|
||||
|
||||
List<ApiKeyVO> resultList = new ArrayList<ApiKeyVO>();
|
||||
resultList = apiKeyMngService.selectApiKeyApplyStatus(apiKeyVO);
|
||||
|
||||
System.out.println("=============");
|
||||
if (resultList.size()>0) {
|
||||
if(StringUtils.isNotEmpty(resultList.get(0).getFrstRegistPnttm()))
|
||||
{
|
||||
@ -250,31 +250,6 @@ public class EgovMypageRESTAPIController{
|
||||
return "web/api/apiSpec";
|
||||
}
|
||||
|
||||
@RequestMapping(value="/web/api/apiAtSpec.do")
|
||||
public String apiAtSpec(ModelMap model)
|
||||
throws Exception {
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
|
||||
if(loginVO == null) {
|
||||
return "redirect:/web/user/login/login.do";
|
||||
}
|
||||
model.addAttribute("loginVO", loginVO);
|
||||
|
||||
return "web/api/apiAtSpec";
|
||||
}
|
||||
@RequestMapping(value="/web/api/apiFtSpec.do")
|
||||
public String apiFtSpec(ModelMap model)
|
||||
throws Exception {
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
|
||||
if(loginVO == null) {
|
||||
return "redirect:/web/user/login/login.do";
|
||||
}
|
||||
model.addAttribute("loginVO", loginVO);
|
||||
|
||||
return "web/api/apiFtSpec";
|
||||
}
|
||||
|
||||
/**
|
||||
* @param model
|
||||
* @return
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -19,8 +19,6 @@ public class SendLogVO {
|
||||
/*내용*/
|
||||
private String contents;
|
||||
|
||||
private String sendMsgType;
|
||||
|
||||
|
||||
public String getSendId() {
|
||||
return sendId;
|
||||
@ -64,13 +62,5 @@ public class SendLogVO {
|
||||
public void setContents(String contents) {
|
||||
this.contents = contents;
|
||||
}
|
||||
public String getSendMsgType() {
|
||||
return sendMsgType;
|
||||
}
|
||||
public void setSendMsgType(String sendMsgType) {
|
||||
this.sendMsgType = sendMsgType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -251,6 +251,4 @@ public interface EgovMberManageService {
|
||||
|
||||
public String findTopByregDateFromCertLog(AuthCertVO authCertVO);
|
||||
|
||||
//사용자 헤더 정보(단가, 이벤트 활성화 기간)
|
||||
public MberManageVO selectMberHeaderInfo(String mberId) throws Exception;
|
||||
}
|
||||
@ -220,6 +220,4 @@ public interface EgovUserManageService {
|
||||
|
||||
public Map<String, Object> selectFaxSendList(FaxGroupDataVO faxGroupDataVO);
|
||||
|
||||
// 마지막 결제수단 조회
|
||||
public String selectLastPayMethod(String mberId) throws Exception;
|
||||
}
|
||||
@ -512,39 +512,6 @@ public class MberManageVO extends UserDefaultVO{
|
||||
*/
|
||||
private String secuLoginFlag;
|
||||
|
||||
|
||||
/**
|
||||
* 회원 이벤트 정보
|
||||
*/
|
||||
private String eventEndDate; //회원 이벤트 종료일자
|
||||
private double eventRemainCash; //이벤트 차감 후 남은 Cash
|
||||
private float eventShortPrice; //이벤트 단문 가격
|
||||
private float eventLongPrice; //이벤트 장문 가격
|
||||
private float eventPicturePrice; //이벤트 그림 1장 가격
|
||||
private float eventPicture2Price; //이벤트 그림 2장 가격
|
||||
private float eventPicture3Price; //이벤트 그림 3장 가격
|
||||
private String eventLeftDay; //이벤트 남은 기간
|
||||
|
||||
/**
|
||||
* 헤더 영역 정보(단가, 발송가능 건수)
|
||||
*/
|
||||
private float headerShortPrice;
|
||||
private float headerLongPrice;
|
||||
private float headerPicturePrice;
|
||||
private float headerPicture2Price;
|
||||
private float headerPicture3Price;
|
||||
private float headerKakaoAtPrice;
|
||||
private float headerKakaoFtPrice;
|
||||
private float headerFaxPrice;
|
||||
private int headerShortCnt;
|
||||
private int headerLongCnt;
|
||||
private int headerPictureCnt;
|
||||
private int headerPicture2Cnt;
|
||||
private int headerPicture3Cnt;
|
||||
private int headerKakaoAtCnt;
|
||||
private int headerKakaoFtCnt;
|
||||
private int headerFaxCnt;
|
||||
|
||||
public String getSmsCode() {
|
||||
return smsCode;
|
||||
}
|
||||
@ -1837,150 +1804,6 @@ public class MberManageVO extends UserDefaultVO{
|
||||
public void setSecuLoginFlag(String secuLoginFlag) {
|
||||
this.secuLoginFlag = secuLoginFlag;
|
||||
}
|
||||
public String getEventEndDate() {
|
||||
return eventEndDate;
|
||||
}
|
||||
public void setEventEndDate(String eventEndDate) {
|
||||
this.eventEndDate = eventEndDate;
|
||||
}
|
||||
public double getEventRemainCash() {
|
||||
return eventRemainCash;
|
||||
}
|
||||
public void setEventRemainCash(double eventRemainCash) {
|
||||
this.eventRemainCash = eventRemainCash;
|
||||
}
|
||||
public float getEventShortPrice() {
|
||||
return eventShortPrice;
|
||||
}
|
||||
public void setEventShortPrice(float eventShortPrice) {
|
||||
this.eventShortPrice = eventShortPrice;
|
||||
}
|
||||
public float getEventLongPrice() {
|
||||
return eventLongPrice;
|
||||
}
|
||||
public void setEventLongPrice(float eventLongPrice) {
|
||||
this.eventLongPrice = eventLongPrice;
|
||||
}
|
||||
public float getEventPicturePrice() {
|
||||
return eventPicturePrice;
|
||||
}
|
||||
public void setEventPicturePrice(float eventPicturePrice) {
|
||||
this.eventPicturePrice = eventPicturePrice;
|
||||
}
|
||||
public float getEventPicture2Price() {
|
||||
return eventPicture2Price;
|
||||
}
|
||||
public void setEventPicture2Price(float eventPicture2Price) {
|
||||
this.eventPicture2Price = eventPicture2Price;
|
||||
}
|
||||
public float getEventPicture3Price() {
|
||||
return eventPicture3Price;
|
||||
}
|
||||
public void setEventPicture3Price(float eventPicture3Price) {
|
||||
this.eventPicture3Price = eventPicture3Price;
|
||||
}
|
||||
public String getEventLeftDay() {
|
||||
return eventLeftDay;
|
||||
}
|
||||
public void setEventLeftDay(String eventLeftDay) {
|
||||
this.eventLeftDay = eventLeftDay;
|
||||
}
|
||||
public float getHeaderShortPrice() {
|
||||
return headerShortPrice;
|
||||
}
|
||||
public void setHeaderShortPrice(float headerShortPrice) {
|
||||
this.headerShortPrice = headerShortPrice;
|
||||
}
|
||||
public float getHeaderLongPrice() {
|
||||
return headerLongPrice;
|
||||
}
|
||||
public void setHeaderLongPrice(float headerLongPrice) {
|
||||
this.headerLongPrice = headerLongPrice;
|
||||
}
|
||||
public float getHeaderPicturePrice() {
|
||||
return headerPicturePrice;
|
||||
}
|
||||
public void setHeaderPicturePrice(float headerPicturePrice) {
|
||||
this.headerPicturePrice = headerPicturePrice;
|
||||
}
|
||||
public float getHeaderPicture2Price() {
|
||||
return headerPicture2Price;
|
||||
}
|
||||
public void setHeaderPicture2Price(float headerPicture2Price) {
|
||||
this.headerPicture2Price = headerPicture2Price;
|
||||
}
|
||||
public float getHeaderPicture3Price() {
|
||||
return headerPicture3Price;
|
||||
}
|
||||
public void setHeaderPicture3Price(float headerPicture3Price) {
|
||||
this.headerPicture3Price = headerPicture3Price;
|
||||
}
|
||||
public int getHeaderShortCnt() {
|
||||
return headerShortCnt;
|
||||
}
|
||||
public void setHeaderShortCnt(int headerShortCnt) {
|
||||
this.headerShortCnt = headerShortCnt;
|
||||
}
|
||||
public int getHeaderLongCnt() {
|
||||
return headerLongCnt;
|
||||
}
|
||||
public void setHeaderLongCnt(int headerLongCnt) {
|
||||
this.headerLongCnt = headerLongCnt;
|
||||
}
|
||||
public int getHeaderPictureCnt() {
|
||||
return headerPictureCnt;
|
||||
}
|
||||
public void setHeaderPictureCnt(int headerPictureCnt) {
|
||||
this.headerPictureCnt = headerPictureCnt;
|
||||
}
|
||||
public int getHeaderPicture2Cnt() {
|
||||
return headerPicture2Cnt;
|
||||
}
|
||||
public void setHeaderPicture2Cnt(int headerPicture2Cnt) {
|
||||
this.headerPicture2Cnt = headerPicture2Cnt;
|
||||
}
|
||||
public int getHeaderPicture3Cnt() {
|
||||
return headerPicture3Cnt;
|
||||
}
|
||||
public void setHeaderPicture3Cnt(int headerPicture3Cnt) {
|
||||
this.headerPicture3Cnt = headerPicture3Cnt;
|
||||
}
|
||||
public float getHeaderKakaoAtPrice() {
|
||||
return headerKakaoAtPrice;
|
||||
}
|
||||
public void setHeaderKakaoAtPrice(float headerKakaoAtPrice) {
|
||||
this.headerKakaoAtPrice = headerKakaoAtPrice;
|
||||
}
|
||||
public float getHeaderKakaoFtPrice() {
|
||||
return headerKakaoFtPrice;
|
||||
}
|
||||
public void setHeaderKakaoFtPrice(float headerKakaoFtPrice) {
|
||||
this.headerKakaoFtPrice = headerKakaoFtPrice;
|
||||
}
|
||||
public float getHeaderFaxPrice() {
|
||||
return headerFaxPrice;
|
||||
}
|
||||
public void setHeaderFaxPrice(float headerFaxPrice) {
|
||||
this.headerFaxPrice = headerFaxPrice;
|
||||
}
|
||||
public int getHeaderKakaoAtCnt() {
|
||||
return headerKakaoAtCnt;
|
||||
}
|
||||
public void setHeaderKakaoAtCnt(int headerKakaoAtCnt) {
|
||||
this.headerKakaoAtCnt = headerKakaoAtCnt;
|
||||
}
|
||||
public int getHeaderKakaoFtCnt() {
|
||||
return headerKakaoFtCnt;
|
||||
}
|
||||
public void setHeaderKakaoFtCnt(int headerKakaoFtCnt) {
|
||||
this.headerKakaoFtCnt = headerKakaoFtCnt;
|
||||
}
|
||||
public int getHeaderFaxCnt() {
|
||||
return headerFaxCnt;
|
||||
}
|
||||
public void setHeaderFaxCnt(int headerFaxCnt) {
|
||||
this.headerFaxCnt = headerFaxCnt;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -883,10 +883,4 @@ public class EgovUserManageServiceImpl extends EgovAbstractServiceImpl implement
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
// 마지막 결제수단 SELECT
|
||||
@Override
|
||||
public String selectLastPayMethod(String mberId) throws Exception {
|
||||
return userManageDAO.selectLastPayMethod(mberId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -321,8 +321,4 @@ public class UserManageDAO extends EgovAbstractDAO{
|
||||
return (int) select("userManageDAO.selectUserPrePaymentPGdataCount", userId);
|
||||
}
|
||||
|
||||
// 마지막 결제수단 SELECT
|
||||
public String selectLastPayMethod(String mberId) throws Exception{
|
||||
return (String) select("userManageDAO.selectLastPayMethod", mberId);
|
||||
}
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
package itn.let.utl.user.service;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service("indexNowUtil")
|
||||
public class IndexNowUtil {
|
||||
|
||||
private static final String INDEXNOW_API_URL = "https://api.indexnow.org/indexnow";
|
||||
private static final String INDEXNOW_KEY = "d09a9f949e6e48eeb221d7a13bdb1d14"; // 🔁 여기에 실제 키 입력
|
||||
private static final String HOST = "www.munjaon.co.kr"; // 🔁 도메인만 입력 (https:// 없이)
|
||||
|
||||
public static void submitUrl(String urlToSubmit) {
|
||||
try {
|
||||
URL url = new URL(INDEXNOW_API_URL);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "application/json; utf-8");
|
||||
connection.setDoOutput(true);
|
||||
|
||||
// JSON 데이터 구성
|
||||
String jsonInputString = "{"
|
||||
+ "\"host\":\"" + HOST + "\","
|
||||
+ "\"key\":\"" + INDEXNOW_KEY + "\","
|
||||
+ "\"urlList\":[\"" + urlToSubmit + "\"]"
|
||||
+ "}";
|
||||
|
||||
try (OutputStream os = connection.getOutputStream()) {
|
||||
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
|
||||
os.write(input, 0, input.length);
|
||||
}
|
||||
|
||||
int responseCode = connection.getResponseCode();
|
||||
if (responseCode == 200 || responseCode == 202) {
|
||||
System.out.println("✅ IndexNow 전송 성공: " + urlToSubmit);
|
||||
} else {
|
||||
System.out.println("❌ 전송 실패 - 응답 코드: " + responseCode + " : " + urlToSubmit);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("🚫 오류 발생: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
public static void main(String[] args) {
|
||||
// 테스트용 URL 전송
|
||||
submitUrl("https://yourdomain.com/new-post.html"); // 🔁 여기에 전송할 실제 URL 입력
|
||||
}
|
||||
*/
|
||||
}
|
||||
@ -12,9 +12,6 @@ import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
import java.security.spec.RSAPublicKeySpec;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@ -109,7 +106,6 @@ import itn.let.lett.service.LetterVO;
|
||||
import itn.let.mjo.addr.service.AddrTransHistService;
|
||||
import itn.let.mjo.addr.service.AddrTransHistVO;
|
||||
import itn.let.mjo.event.service.MjonEventService;
|
||||
import itn.let.mjo.event.service.MjonEventVO;
|
||||
import itn.let.mjo.kisa.service.KisaService;
|
||||
import itn.let.mjo.kisa.service.KisaVO;
|
||||
import itn.let.mjo.mjocommon.MjonForienIpChk;
|
||||
@ -134,7 +130,6 @@ import itn.let.sym.mnu.mpm.service.MenuManageVO;
|
||||
import itn.let.sym.prm.service.EgovProgrmManageService;
|
||||
import itn.let.sym.prm.service.ProgrmManageVO;
|
||||
import itn.let.sym.site.service.EgovSiteManagerService;
|
||||
import itn.let.sym.site.service.JoinSettingVO;
|
||||
import itn.let.sym.site.service.MetaTagVO;
|
||||
import itn.let.sym.site.service.SiteManagerVO;
|
||||
import itn.let.uss.umt.service.EgovMberManageService;
|
||||
@ -1261,16 +1256,6 @@ public class MainController {
|
||||
model.addAttribute("mberManageVO", userManageService.selectUserInfo(mberManageVO));
|
||||
}
|
||||
|
||||
/*
|
||||
* 회원별 단가, 기본 단가, 이벤트 정보 조회
|
||||
* 2025.07.25 이지우 추가
|
||||
* */
|
||||
MberManageVO mberHeaderInfoVO = new MberManageVO();
|
||||
if(loginVO != null) {
|
||||
mberHeaderInfoVO = mberManageService.selectMberHeaderInfo(loginVO.getId());
|
||||
}
|
||||
model.addAttribute("mberHeaderInfoVO", mberHeaderInfoVO);
|
||||
|
||||
return "web/com/webCommonHeader";
|
||||
}
|
||||
|
||||
|
||||
@ -28,16 +28,15 @@ Globals.Env = dev
|
||||
|
||||
# mysql
|
||||
Globals.DriverClassName=com.mysql.jdbc.Driver
|
||||
Globals.Url=jdbc:mysql://192.168.0.60:3308/mjon_advc?useUnicode=true&connectionCollation=utf8mb4_unicode_ci&serverTimezone=Asia/Seoul
|
||||
#Globals.Url=jdbc:mysql://139.150.73.12:3306/mjon
|
||||
Globals.UserName= mjonUr
|
||||
Globals.Password= mjon!@#$
|
||||
#Globals.Url=jdbc:mysql://192.168.0.125:3306/mjon
|
||||
#Globals.UserName= mjonUr
|
||||
#Globals.Password= mjon!@#$
|
||||
|
||||
# mysql-prod
|
||||
#Globals.DriverClassName=com.mysql.jdbc.Driver
|
||||
#Globals.Url=jdbc:mysql://139.150.72.157:3306/mjon
|
||||
#Globals.UserName= mjonUr
|
||||
#Globals.Password= mjon!@#$
|
||||
Globals.Url=jdbc:mysql://139.150.72.157:3306/mjon
|
||||
Globals.UserName= mjonUr
|
||||
Globals.Password= mjon!@#$
|
||||
|
||||
# MainPage Setting(admin)
|
||||
Globals.MainPage = /cmm/main/mainPage.do
|
||||
@ -118,8 +117,3 @@ Globals.pay.kgm.mobile.payMode=00
|
||||
#Slack
|
||||
Globals.slack.hooks.url=https://hooks.slack.com/services/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
|
||||
Globals.slack.channel.name=\ud14c\uc2a4\ud2b8_mjon\uba54\uc2dc\uc9c0
|
||||
|
||||
#valkey
|
||||
Globals.valkey.ip=192.168.0.60
|
||||
Globals.valkey.port=6379
|
||||
Globals.valkey.password=itntest123
|
||||
@ -28,10 +28,8 @@ Globals.Env = local
|
||||
|
||||
# mysql
|
||||
Globals.DriverClassName=com.mysql.jdbc.Driver
|
||||
#Globals.Url=jdbc:mysql://192.168.0.60:3308/mjon_advc
|
||||
#Globals.Url=jdbc:mysql://192.168.0.60:3308/mjon_advc?characterEncoding=UTF-8&useUnicode=true&serverTimezone=Asia/Seoul
|
||||
Globals.Url=jdbc:mysql://192.168.0.60:3308/mjon_advc?useUnicode=true&connectionCollation=utf8mb4_unicode_ci&serverTimezone=Asia/Seoul
|
||||
|
||||
Globals.Url=jdbc:mysql://119.193.215.98:3306/mjon
|
||||
#Globals.Url=jdbc:mysql://192.168.0.60:3308/mjon
|
||||
Globals.UserName= mjonUr
|
||||
Globals.Password= mjon!@#$
|
||||
#Globals.Url=jdbc:mysql://192.168.0.125:3306/mjon
|
||||
@ -126,8 +124,3 @@ Globals.pay.kgm.mobile.payMode=00
|
||||
#Slack
|
||||
Globals.slack.hooks.url=https://hooks.slack.com/services/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
|
||||
Globals.slack.channel.name=\ud14c\uc2a4\ud2b8_mjon\uba54\uc2dc\uc9c0
|
||||
|
||||
#valkey
|
||||
Globals.valkey.ip=192.168.0.60
|
||||
Globals.valkey.port=6379
|
||||
Globals.valkey.password=itntest123
|
||||
|
||||
@ -27,7 +27,7 @@ Globals.Env = prod
|
||||
|
||||
# mysql
|
||||
Globals.DriverClassName=com.mysql.jdbc.Driver
|
||||
Globals.Url=jdbc:mysql://10.12.107.14:3306/mjon_advc?useUnicode=true&connectionCollation=utf8mb4_unicode_ci&serverTimezone=Asia/Seoul
|
||||
Globals.Url=jdbc:mysql://10.12.107.4:3306/mjon
|
||||
Globals.UserName= mjonUr
|
||||
Globals.Password= mjon!@#$
|
||||
|
||||
@ -106,8 +106,3 @@ Globals.pay.kgm.mobile.payMode=10
|
||||
#Slack
|
||||
Globals.slack.hooks.url=https://hooks.slack.com/services/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
|
||||
Globals.slack.channel.name=mjon\uba54\uc2dc\uc9c0
|
||||
|
||||
#valkey
|
||||
Globals.valkey.ip=10.12.107.9
|
||||
Globals.valkey.port=6379
|
||||
Globals.valkey.password=itntest123
|
||||
@ -4,7 +4,7 @@
|
||||
xmlns:security="http://www.springframework.org/schema/security"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
|
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-4.2.xsd
|
||||
http://www.egovframe.go.kr/schema/egov-security http://maven.egovframe.go.kr/schema/egov-security/egov-security-3.7.xsd">
|
||||
http://www.egovframe.go.kr/schema/egov-security http://www.egovframe.go.kr/schema/egov-security/egov-security-3.7.xsd">
|
||||
|
||||
<security:http pattern="/css/**" security="none"/>
|
||||
<security:http pattern="/html/**" security="none"/>
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<sqlMap namespace="MjonCertPhone">
|
||||
<typeAlias alias="mberCertPhoneVO" type="itn.let.cert.phone.service.MberCertPhoneVO"/>
|
||||
<typeAlias alias="AuthCertVO" type="itn.let.uat.uia.service.AuthCertVO"/>
|
||||
|
||||
|
||||
<select id="mberCertPhoneVO.selectMberCertPhoneList" parameterClass="String" resultClass="mberCertPhoneVO">
|
||||
/* mberCertPhoneVO.selectMberCertPhoneList */
|
||||
@ -131,39 +131,4 @@
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="certPhoneDAO.selectCertUrlCode" parameterClass="mberCertPhoneVO" resultClass="mberCertPhoneVO">
|
||||
SELECT
|
||||
URL_CODE as urlCode
|
||||
, URL as url
|
||||
, HOST as host
|
||||
FROM
|
||||
MJ_CERT_SETTING
|
||||
WHERE
|
||||
URL = #url#
|
||||
AND HOST = #host#
|
||||
</select>
|
||||
|
||||
<insert id="certPhoneDAO.insertCertLog" parameterClass="AuthCertVO">
|
||||
|
||||
insert into mj_cert_log
|
||||
(
|
||||
MBER_ID
|
||||
, CERT_DATE
|
||||
, CERT_TYPE
|
||||
, CERT_IPADDR
|
||||
, REGDATE
|
||||
)
|
||||
values (
|
||||
#mberId#
|
||||
, #certDate#
|
||||
, #certType#
|
||||
, #certIpaddr#
|
||||
, now()
|
||||
);
|
||||
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
</sqlMap>
|
||||
@ -569,8 +569,10 @@
|
||||
on A.ADDR_GRP_ID = mag.ADDR_GRP_ID
|
||||
WHERE
|
||||
A.MBER_ID = #mberId#
|
||||
AND (A.RECV_STATUS IN ('Y', 'S') OR A.RECV_STATUS IS NULL)
|
||||
AND (A.ADDR_GRP_ID IS NULL OR MAG.DELETE_YN = 'N')
|
||||
AND (A.RECV_STATUS = 'Y'
|
||||
or A.RECV_STATUS = 'S'
|
||||
or A.RECV_STATUS is null)
|
||||
AND mag.DELETE_YN = 'N'
|
||||
</select>
|
||||
|
||||
<!-- 주소록 상세 조회 -->
|
||||
@ -1352,32 +1354,34 @@
|
||||
, BOOKMARK
|
||||
, RECV_STATUS
|
||||
)
|
||||
SELECT t.ADDR_GRP_ID,
|
||||
t.MBER_ID,
|
||||
t.ADDR_NM,
|
||||
FN_GETHYPHEN(t.ADDR_PHONE_NO),
|
||||
t.ADDR_INFO1,
|
||||
t.ADDR_INFO2,
|
||||
t.ADDR_INFO3,
|
||||
t.ADDR_INFO4,
|
||||
t.ADDR_COMMENT,
|
||||
t.FRST_REGIST_PNTTM,
|
||||
t.FRST_REGISTER_ID,
|
||||
t.LAST_UPDT_PNTTM,
|
||||
t.LAST_UPDUSR_ID,
|
||||
t.DELETE_YN,
|
||||
t.BOOKMARK,
|
||||
t.RECV_STATUS
|
||||
FROM TEMP_MJ_ADDR AS t
|
||||
LEFT JOIN MJ_ADDR AS m
|
||||
ON m.MBER_ID = t.MBER_ID
|
||||
AND m.ADDR_GRP_ID = t.ADDR_GRP_ID
|
||||
AND m.BOOKMARK = t.BOOKMARK
|
||||
AND replace(m.ADDR_PHONE_NO, '-', '') = replace(t.ADDR_PHONE_NO, '-', '')
|
||||
WHERE t.MBER_ID = #mberId#
|
||||
AND t.ADDR_GRP_ID = #addrGrpId#
|
||||
AND t.BOOKMARK = #bookmark#
|
||||
AND m.MBER_ID IS NULL
|
||||
SELECT
|
||||
ADDR_GRP_ID
|
||||
, MBER_ID
|
||||
, ADDR_NM
|
||||
, ADDR_PHONE_NO
|
||||
, ADDR_INFO1
|
||||
, ADDR_INFO2
|
||||
, ADDR_INFO3
|
||||
, ADDR_INFO4
|
||||
, ADDR_COMMENT
|
||||
, FRST_REGIST_PNTTM
|
||||
, FRST_REGISTER_ID
|
||||
, LAST_UPDT_PNTTM
|
||||
, LAST_UPDUSR_ID
|
||||
, DELETE_YN
|
||||
, BOOKMARK
|
||||
, RECV_STATUS
|
||||
FROM TEMP_MJ_ADDR
|
||||
WHERE MBER_ID = #mberId#
|
||||
AND ADDR_GRP_ID = #addrGrpId#
|
||||
AND BOOKMARK = #bookmark#
|
||||
AND ADDR_PHONE_NO NOT IN
|
||||
(
|
||||
SELECT ADDR_PHONE_NO FROM MJ_ADDR
|
||||
WHERE MBER_ID = #mberId#
|
||||
AND ADDR_GRP_ID = #addrGrpId#
|
||||
AND BOOKMARK = #bookmark#
|
||||
)
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
@ -85,11 +85,4 @@
|
||||
DELETE FROM lettngnrlmber_access_call_info
|
||||
WHERE access_no = #accessNo#
|
||||
</delete>
|
||||
|
||||
<update id="ApiCallInfoMngDAO.updateApiCallInfoAll" parameterClass="apiKeyVO">
|
||||
UPDATE lettngnrlmber_access_call_info
|
||||
SET use_yn = #useYn#
|
||||
WHERE access_no = #accessNo#
|
||||
|
||||
</update>
|
||||
</sqlMap>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user