문자발송 연계 소스 이동(xit-mms)

main
이범준 4 days ago
parent 9cd8f1af54
commit f5c24deacb

@ -9,14 +9,14 @@
<version>2.7.18</version> <version>2.7.18</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>cokr.xit.app</groupId> <groupId>cokr.xit.app</groupId>
<artifactId>fims-java-rent</artifactId> <artifactId>fims-java-rent</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<name>fims-java-rent</name> <name>fims-java-rent</name>
<description>과태료통합관리시스템java-rent</description> <description>과태료통합관리시스템java-rent</description>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>17</java.version> <java.version>17</java.version>
@ -28,7 +28,7 @@
<url>https://nas.xit.co.kr:8888/repository/maven-public/</url> <url>https://nas.xit.co.kr:8888/repository/maven-public/</url>
</repository> </repository>
</repositories> </repositories>
<pluginRepositories> <pluginRepositories>
<pluginRepository> <pluginRepository>
<id>maven-public</id> <id>maven-public</id>
@ -41,9 +41,9 @@
</releases> </releases>
</pluginRepository> </pluginRepository>
</pluginRepositories> </pluginRepositories>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.egovframe.rte</groupId> <groupId>org.egovframe.rte</groupId>
@ -65,7 +65,7 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>3rd-party</groupId> <groupId>3rd-party</groupId>
<artifactId>echelon</artifactId> <artifactId>echelon</artifactId>
@ -76,20 +76,27 @@
<artifactId>dguard</artifactId> <artifactId>dguard</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>cokr.xit.app</groupId> <groupId>cokr.xit.app</groupId>
<artifactId>fims-java-public</artifactId> <artifactId>fims-java-public</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</dependency> </dependency>
<!-- 문자전송 -->
<dependency>
<groupId>cokr.xit.interfaces</groupId>
<artifactId>xit-mms</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
@ -210,6 +217,6 @@
</repository> </repository>
</distributionManagement> </distributionManagement>
<!-- Nexus deploy --> <!-- Nexus deploy -->
</project> </project>

@ -1,413 +0,0 @@
package cokr.xit.fims.mngt;
import org.assertj.core.util.Arrays;
import cokr.xit.foundation.AbstractEntity;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class MsgEntity extends AbstractEntity {
/**
*
*/
private String msgKey;
/**
* G/W
*/
private String subId;
/**
*
*/
private String userKey;
/**
*
*/
private String userGroup;
/**
*
*/
private String userId;
/**
* JOB
*/
private String userJobid;
/**
* ( )
*/
private String centerKey;
/**
* ( )
*/
private String msgPriority;
/**
*
*/
private String msgState;
/**
* (DB )
*/
private String inputDate;
/**
*
*/
private String resDate;
/**
*
*/
private String queDate;
/**
*
*/
private String sentDate;
/**
*
*/
private String rsltDate;
/**
* G/W
*/
private String reportDate;
/**
*
*/
private String rsltCode;
/**
*
*/
private String rsltNet;
/**
*
*/
private String rsltType;
/**
*
*/
private String sentCount;
/**
*
*/
private String historyMsgType;
/**
*
*/
private String historyRsltCode;
/**
*
*/
private String identifier;
/**
*
*/
private String phone;
/**
*
*/
private String callback;
/**
* 1
*/
private String msgType1;
/**
* 1
*/
private String contentsType1;
/**
* 1
*/
private String queDate1;
/**
* 1
*/
private String sentDate1;
/**
* 2
*/
private String msgType2;
/**
* 2
*/
private String contentsType2;
/**
* 2
*/
private String queDate2;
/**
* 2
*/
private String sentDate2;
/**
* 3
*/
private String msgType3;
/**
* 3
*/
private String contentsType3;
/**
* 3
*/
private String queDate3;
/**
* 3
*/
private String sentDate3;
/**
* XMS
*/
private String xmsRsltCode;
/**
* XMS
*/
private String xmsRsltNet;
/**
* XMS
*/
private String xmsRsltDate;
/**
* XMS G/W
*/
private String xmsReportDate;
/**
* ALT
*/
private String altRsltCode;
/**
* ALT
*/
private String altRsltNet;
/**
* ALT
*/
private String altRsltDate;
/**
* ALT G/W
*/
private String altReportDate;
/**
* RCS
*/
private String rcsRsltCode;
/**
* RCS
*/
private String rcsRsltNet;
/**
* RCS
*/
private String rcsRsltDate;
/**
* RCS G/W
*/
private String rcsReportDate;
/**
* (LMS/MMS)
*/
private String xmsSubject;
/**
* (SMS/LMS/MMS)
*/
private String xmsText;
/**
* 1(MMS)
*/
private String xmsFileName1;
/**
* 2(MMS)
*/
private String xmsFileName2;
/**
* 3(MMS)
*/
private String xmsFileName3;
/**
* ALT (ALT,ALI)
*/
private String altCountryCode;
/**
* ALT (ALT,ALI)
*/
private String altSenderKey;
/**
* ALT 릿 (ALT,ALI)
*/
private String altTemplateCode;
/**
* (ALT,ALI)
*/
private String altJson;
/**
* RCS
*/
private String rcsBrandKey;
/**
* RCS
*/
private String rcsMassageBaseId;
/**
* (RCS)
*/
private String rcsJson;
/**
*
*/
private String failRsn;
/**
* 1,2,3
*/
public void setMsgTypes(String[] types) {
if(types != null) {
if(types.length == 1) {
this.setMsgType1(types[0]);
this.setMsgType2(null);
this.setMsgType3(null);
} else if(types.length == 2) {
this.setMsgType1(types[0]);
this.setMsgType2(types[1]);
this.setMsgType3(null);
} else if(types.length == 3) {
this.setMsgType1(types[0]);
this.setMsgType2(types[1]);
this.setMsgType3(types[2]);
}
}
}
/**
*
*/
public static String[] SMS = {"SMS"};
public static String[] MMS = {"LMS","MMS"};
public static String[] ALT = {"ALT","ALI","FRT","FRI","FRW"};
public static String[] RCS = {"RCS","RCL","RCM","RCT","RCD","RCF","RIT"};
/**
* (1,2,3 )
*/
public void setContentsTypeN(String contentsType) {
String msgType = "";
if(Arrays.asList(SMS).contains(contentsType)) {
msgType = "SMS";
} else if(Arrays.asList(MMS).contains(contentsType)){
msgType = "MMS";
} else if(Arrays.asList(ALT).contains(contentsType)) {
msgType = "ALT";
} else if(Arrays.asList(RCS).contains(contentsType)) {
msgType = "RCS";
}
if(msgType.equals(this.msgType1)) {
this.contentsType1 = contentsType;
} else if(msgType.equals(this.msgType2)) {
this.contentsType2 = contentsType;
} else if(msgType.equals(this.msgType3)) {
this.contentsType3 = contentsType;
}
}
/**
* RCS
*/
public String getContentsTypeOfRCS() {
if("RCS".equals(this.msgType1)) {
return this.contentsType1;
} else if("RCS".equals(this.msgType2)){
return this.contentsType2;
} else if("RCS".equals(this.msgType3)){
return this.contentsType3;
}
return null;
}
/**
*
*/
public String getContentsTypeOfALT() {
if("ALT".equals(this.msgType1)) {
return this.contentsType1;
} else if("ALT".equals(this.msgType2)){
return this.contentsType2;
} else if("ALT".equals(this.msgType3)){
return this.contentsType3;
}
return null;
}
/**
* XMS
*/
public String getContentsTypeOfXMS() {
if("SMS".equals(this.msgType1) || "MMS".equals(this.msgType1)) {
return this.contentsType1;
} else if("SMS".equals(this.msgType2) || "MMS".equals(this.msgType2)) {
return this.contentsType2;
} else if("SMS".equals(this.msgType3) || "MMS".equals(this.msgType3)) {
return this.contentsType3;
}
return null;
}
}

@ -1,48 +0,0 @@
package cokr.xit.fims.mngt;
import cokr.xit.fims.cmmn.CmmnQuery;
public class MsgQuery extends CmmnQuery {
private static final long serialVersionUID = 1L;
private String schInputYmdFrom;
private String schInputYmdTo;
private String stngInfoType; //설정정보유형(01:게이트웨이ID,02:송신전화번호,03:서비스사용자ID,04:템플릿)
private String msgPrps; //고장신고,사전알림,주차신고민원,기타민원
private String msgDtlPrps;
private String callback;
private String phone;
private String msgState;
public String getSchInputYmdFrom() {
return ifEmpty(schInputYmdFrom, () -> null);
}
public <T extends CmmnQuery> T setSchInputYmdFrom(String schInputYmdFrom) {
this.schInputYmdFrom = schInputYmdFrom;
return self();
}
public String getSchInputYmdTo() {
return ifEmpty(schInputYmdTo, () -> null);
}
public <T extends CmmnQuery> T setSchInputYmdTo(String schInputYmdTo) {
this.schInputYmdTo = schInputYmdTo;
return self();
}
public String getStngInfoType() {
return ifEmpty(stngInfoType, () -> null);
}
public <T extends CmmnQuery> T setStngInfoType(String stngInfoType) {
this.stngInfoType = stngInfoType;
return self();
}
}

@ -1,20 +0,0 @@
package cokr.xit.fims.mngt.dao;
import java.util.List;
import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
import cokr.xit.fims.mngt.MsgEntity;
import cokr.xit.fims.mngt.MsgQuery;
import cokr.xit.foundation.component.AbstractMapper;
import cokr.xit.foundation.data.DataObject;
@Mapper("msgMapper")
public interface MsgMapper extends AbstractMapper {
List<DataObject> selectList(MsgQuery msgQuery);
int insert(MsgEntity msgEntity);
DataObject selectStng(MsgQuery msgQuery);
}

@ -1,17 +0,0 @@
package cokr.xit.fims.mngt.service;
import java.util.List;
import java.util.Map;
import cokr.xit.fims.mngt.MsgEntity;
import cokr.xit.fims.mngt.MsgQuery;
import cokr.xit.foundation.data.DataObject;
public interface MsgService {
List<DataObject> getList(MsgQuery msgQuery);
Map<String,Object> regist(List<MsgEntity> msgEntity);
}

@ -1,33 +0,0 @@
package cokr.xit.fims.mngt.service.bean;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cokr.xit.fims.mngt.MsgEntity;
import cokr.xit.fims.mngt.MsgQuery;
import cokr.xit.fims.mngt.dao.MsgMapper;
import cokr.xit.foundation.component.AbstractBean;
import cokr.xit.foundation.data.DataObject;
@Component("msgBean")
public class MsgBean extends AbstractBean {
@Resource(name="msgMapper")
private MsgMapper msgMapper;
public List<DataObject> getList(MsgQuery msgQuery) {
if(ifEmpty(msgQuery.getOrderBy(), ()->"").equals("")) {
msgQuery.setOrderBy("MSG_KEY");
}
return msgMapper.selectList(msgQuery);
}
public boolean regist(MsgEntity msgEntity) {
int result = msgMapper.insert(msgEntity);
return result == 1 ? true : false;
}
}

@ -1,176 +0,0 @@
package cokr.xit.fims.mngt.service.bean;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.sql.DataSource;
import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
import org.egovframe.rte.fdl.string.EgovStringUtil;
import org.springframework.stereotype.Service;
import cokr.xit.applib.AppCmmnUtil;
import cokr.xit.applib.Hangul;
import cokr.xit.fims.mngt.MsgEntity;
import cokr.xit.fims.mngt.MsgQuery;
import cokr.xit.fims.mngt.service.MsgService;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
@Service("msgService")
public class MsgServiceBean extends AbstractServiceBean implements MsgService {
@Resource(name="databaseIdProvider")
private VendorDatabaseIdProvider databaseIdProvider;
@Resource(name="dataSource")
private DataSource dataSource;
@Resource(name="msgBean")
private MsgBean msgBean;
@Override
public List<DataObject> getList(MsgQuery msgQuery) {
return msgBean.getList(msgQuery);
}
@Override
public Map<String,Object> regist(List<MsgEntity> msgEntityList) {
Map<String,Object> resultMap = new HashMap<String,Object>();
List<MsgEntity> successList = new ArrayList<MsgEntity>();
List<MsgEntity> failList = new ArrayList<MsgEntity>();
String databaseId = databaseIdProvider.getDatabaseId(dataSource);
for(MsgEntity msgEntity : msgEntityList) {
boolean isSuccess = false;
//발신전화 검증
if(ifEmpty(msgEntity.getCallback(), ()->"").equals("")) {
isSuccess = false;
msgEntity.setFailRsn("발신 전화번호 없음");
failList.add(msgEntity);
continue;
}
if(!AppCmmnUtil.isTelno(msgEntity.getCallback())) {
isSuccess = false;
msgEntity.setFailRsn("발신 가능한 전화번호 형식이 아님");
failList.add(msgEntity);
continue;
}
//수신전화 검증
if(ifEmpty(msgEntity.getPhone(), ()->"").equals("")) {
isSuccess = false;
msgEntity.setFailRsn("수신 전화번호 없음");
failList.add(msgEntity);
continue;
}
if(!AppCmmnUtil.isReceivePhone(msgEntity.getPhone())) {
isSuccess = false;
msgEntity.setFailRsn("수신 가능한 전화번호 형식이 아님");
failList.add(msgEntity);
continue;
}
//발송예약일시 검증
if(!ifEmpty(msgEntity.getResDate(), ()->"").equals("")) {
if(!AppCmmnUtil.isDateTimeDigitPattern(msgEntity.getResDate())) {
isSuccess = false;
msgEntity.setFailRsn("발송예약일시가 연월일시분초 형식이 아님");
failList.add(msgEntity);
continue;
}
}
Hangul hangul = new Hangul(2);
//알림톡 검증
if(!EgovStringUtil.null2void(msgEntity.getAltSenderKey()).equals("")) {
String altJson = msgEntity.getAltJson();
if(altJson.length() > 1000) {
isSuccess = false;
msgEntity.setFailRsn("알림톡 글자수(1000자) 초과");
failList.add(msgEntity);
continue;
}
}
//RCS 검증
if(!EgovStringUtil.null2void(msgEntity.getRcsBrandKey()).equals("")) {
String rcsJson = msgEntity.getRcsJson();
//
}
//XMS 제목 바이트 수
int xmsSubjectByteCnt = hangul.getByteLength(msgEntity.getXmsSubject());
//XMS 내용 바이트 수
int xmsContentByteCnt = hangul.getByteLength(msgEntity.getXmsText());
//XMS 내용 바이트 수 보정(줄바꿈문자)
if(databaseId.equals("mariadb") || databaseId.equals("mysql")) {
int lineChageCount = this.countLineChangeForNuri2Maria(msgEntity.getXmsText());
xmsContentByteCnt = xmsContentByteCnt - (lineChageCount*3);
} else {
int lineChageCount = this.countLineChangeForNuri2Oracle(msgEntity.getXmsText());
xmsContentByteCnt = xmsContentByteCnt - lineChageCount;
}
String contentsTypeOfXMS = msgEntity.getContentsTypeOfXMS();
//XMS 검증
if("SMS".equals(contentsTypeOfXMS) && xmsContentByteCnt > 90) {
isSuccess = false;
msgEntity.setFailRsn("SMS 최대 바이트 수(90byte) 초과");
failList.add(msgEntity);
continue;
}
if("LMS".equals(contentsTypeOfXMS)) {
if(xmsSubjectByteCnt > 30) {
isSuccess = false;
msgEntity.setFailRsn("LMS 제목 최대 바이트 수(30byte) 초과");
failList.add(msgEntity);
continue;
}
if(xmsContentByteCnt > 2000) {
isSuccess = false;
msgEntity.setFailRsn("LMS 내용 최대 바이트 수(2000byte) 초과");
failList.add(msgEntity);
continue;
}
}
isSuccess = msgBean.regist(msgEntity);
if(isSuccess) {
successList.add(msgEntity);
} else {
failList.add(msgEntity);
}
}
resultMap.put("successList", successList);
resultMap.put("failList", failList);
return resultMap;
}
public int countLineChangeForNuri2Oracle(String str) {
if(str == null || str.equals("")) {
return 0;
}
return str.split("\r\n",-1).length - 1;
}
public int countLineChangeForNuri2Maria(String str) {
if(str == null || str.equals("")) {
return 0;
}
return str.split("\\\\r\\\\n",-1).length - 1;
}
}

@ -1,22 +1,15 @@
package cokr.xit.fims.mngt.web; package cokr.xit.fims.mngt.web;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.web.ApplicationController; import cokr.xit.interfaces.message.MessageQuery;
import cokr.xit.fims.mngt.MsgQuery; import cokr.xit.interfaces.message.web.MessageController;
import cokr.xit.fims.mngt.dao.MsgMapper;
import cokr.xit.fims.mngt.service.MsgService;
import cokr.xit.foundation.data.DataObject;
@Controller @Controller
@RequestMapping(name="문자전송 관리", value=Mngt03Controller.CLASS_URL) @RequestMapping(name="문자전송 관리", value=Mngt03Controller.CLASS_URL)
public class Mngt03Controller extends ApplicationController { public class Mngt03Controller extends MessageController {
public static final String CLASS_URL = "/mngt/mngt03"; public static final String CLASS_URL = "/mngt/mngt03";
@ -27,29 +20,20 @@ public class Mngt03Controller extends ApplicationController {
; ;
} }
@Resource(name="msgService")
private MsgService msgService;
@Resource(name="msgMapper")
private MsgMapper msgMapper;
@RequestMapping(name="문자전송 현황 메인", value=METHOD_URL.main) @RequestMapping(name="문자전송 현황 메인", value=METHOD_URL.main)
public ModelAndView main() { public ModelAndView main() {
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
mav.setViewName("fims/mngt/mngt03010-main"); mav.setViewName("fims/mngt/mngt03010-main");
mav.addObject("pageName", "mngt03010"); mav.addObject("pageName", "mngt03010");
return mav; return mav;
} }
@Override
@RequestMapping(name="문자전송 목록", value=METHOD_URL.list) @RequestMapping(name="문자전송 목록", value=METHOD_URL.list)
public ModelAndView list(MsgQuery msgQuery) { public ModelAndView list(MessageQuery messageQuery) {
ModelAndView mav = new ModelAndView("jsonView"); return super.list(messageQuery);
List<DataObject> list = msgService.getList(msgQuery);
return setPagingInfo(mav, list, "");
} }

@ -1,196 +0,0 @@
package cokr.xit.fims.rent.web;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.sql.DataSource;
import org.apache.ibatis.mapping.VendorDatabaseIdProvider;
import org.egovframe.rte.fdl.string.EgovStringUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import cokr.xit.base.web.ApplicationController;
import cokr.xit.fims.mngt.MsgEntity;
import cokr.xit.fims.mngt.MsgQuery;
import cokr.xit.fims.mngt.dao.MsgMapper;
import cokr.xit.fims.mngt.service.MsgService;
import net.minidev.json.JSONObject;
@Controller("rentInterface")
@RequestMapping(value = "/intf/rent", name = "렌트카 관련 연계")
public class RentInterfaceController extends ApplicationController {
@Resource(name="databaseIdProvider")
private VendorDatabaseIdProvider databaseIdProvider;
@Resource(name="dataSource")
private DataSource dataSource;
@Resource(name="msgService")
private MsgService msgService;
@Resource(name="msgMapper")
private MsgMapper msgMapper;
public final static String[] m_b_d = {
"{\"msg\":{\"body\":\"{description\":",
"},},}"
};
public final static String[] t = {
"{\"text\":",
"}"
};
@PostMapping(name="문자전송 요청 등록", value="message/regist")
public ModelAndView regist(@RequestBody JSONObject apiSpec) {
ModelAndView mav = new ModelAndView("jsonView");
//누리2모듈 아이디 찾기
MsgQuery msgQuery = new MsgQuery();
msgQuery.setStngInfoType("01");
msgQuery.setSggCd(System.getProperty("sgg"));
String nuri2Id = msgMapper.selectStng(msgQuery).string("MODULE_ID");
if(ifEmpty(nuri2Id, ()->"").equals("")) {
mav.addObject("failRsn", "문자발송모듈아이디 찾기 실패");
mav.addObject("saved", false);
return mav;
}
String reqSys = (String) apiSpec.get("reqSys"); //요청시스템(이노,진우,엑스아이티)
if(EgovStringUtil.null2void(reqSys).equals("")) {
mav.addObject("failRsn", "요청시스템이 없습니다.");
mav.addObject("saved", false);
return mav;
}
String msgPrps = (String) apiSpec.get("msgPrps"); //목적(고장신고,사전알림,주차신고민원,기타민원)
if(EgovStringUtil.null2void(msgPrps).equals("")) {
mav.addObject("failRsn", "메시지 발송 목적이 없습니다.");
mav.addObject("saved", false);
return mav;
}
String msgDtlPrps = (String) apiSpec.get("msgDtlPrps"); //상세목적
String sggCd = (String) apiSpec.get("sggCd"); //시군구코드
String databaseId = databaseIdProvider.getDatabaseId(dataSource);
List<MsgEntity> msgEntityList = new ArrayList<MsgEntity>();
List<Map> reqs = (List<Map>) apiSpec.get("reqs");
for(Map req : reqs) {
MsgEntity msgEntity = new MsgEntity();
msgEntity.setSubId(nuri2Id);
String trnsmisNo = (String) req.get("trnsmisNo");
String recptnNo = (String) req.get("recptnNo");
String mssageCn = (String) req.get("mssageCn");
String resDate = (String) req.get("resDate");
msgEntity.setCallback(trnsmisNo);
msgEntity.setPhone(recptnNo);
if(databaseId.equals("mariadb") || databaseId.equals("mysql")){
mssageCn = this.replaceLineChangeForNuri2Maria(mssageCn);
} else {
mssageCn = this.replaceLineChangeForNuri2Oracle(mssageCn);
}
if(!EgovStringUtil.null2void(resDate).equals("")) {
msgEntity.setResDate(resDate);
}
boolean able_kko = false; //알림톡 가능 여부
boolean able_rcs = false; //RCS 가능 여부
if(able_kko && able_rcs) { // 알림톡+RCS+XMS
msgEntity.setMsgTypes(new String[]{"ALT","RCS","MMS"});
msgEntity.setContentsTypeN("ALT");
msgEntity.setContentsTypeN("RCL");
msgEntity.setContentsTypeN("LMS");
} else if(able_kko && !able_rcs) { // 알림톡+XMS
msgEntity.setMsgTypes(new String[]{"ALT","MMS"});
msgEntity.setContentsTypeN("ALT");
msgEntity.setContentsTypeN("LMS");
msgEntity.setXmsText(mssageCn);
} else if(!able_kko && able_rcs){ // RCS+XMS
msgEntity.setMsgTypes(new String[]{"RCS","MMS"});
msgEntity.setContentsTypeN("RCL");
msgEntity.setContentsTypeN("LMS");
msgEntity.setXmsText(mssageCn);
} else {// XMS
msgEntity.setMsgTypes(new String[]{"MMS"});
msgEntity.setContentsTypeN("LMS");
}
msgEntity.setXmsText(mssageCn);
if(able_kko) {
String json = t[0] + mssageCn + t[1];
msgEntity.setAltSenderKey("신청한센더키");
msgEntity.setAltTemplateCode("신청한템플릿코드");
msgEntity.setAltJson(json);
}
if(able_rcs) {
msgEntity.setRcsBrandKey("신청한브랜드키");
String json = "";
String contentsTypeOfRCS = msgEntity.getContentsTypeOfRCS();
if("RCS".equals(contentsTypeOfRCS)) {
msgEntity.setRcsMassageBaseId("SS000000");
} else if("RCL".equals(contentsTypeOfRCS)) {
msgEntity.setRcsMassageBaseId("SL000000");
} else {
throw new RuntimeException("");
//RCT //baseid 발급 필요
//RLT //RCT의 오타
//RCD,RCF //baseId 발급 필요,mgov예제에 없는 형식
//RCM,RIT //baseId 발급 필요,필요하지 않는 형식(미디어 첨부)
}
json = m_b_d[0] + mssageCn + m_b_d[1];
msgEntity.setRcsJson(json);
}
msgEntityList.add(msgEntity);
}
//
Map<String,Object> resultMap = msgService.regist(msgEntityList);
mav.addObject("resultMap", resultMap);
mav.addObject("saved",true);
return mav;
}
public String replaceLineChangeForNuri2Oracle(String str) {
String result = "";
result = str.replaceAll("\r","");
result = result.replaceAll("\n","\r\n");
return result;
}
public String replaceLineChangeForNuri2Maria(String str) {
String result = "";
result = str.replaceAll("\r","");
result = result.replaceAll("\n", "\\\\r\\\\n");
return result;
}
}

@ -1,192 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.fims.mngt.dao.MsgMapper">
<select id="selectList" parameterType="cokr.xit.fims.mngt.MsgQuery" resultType="dataObject">
/* 문자전송 목록(msgMapper.selectList) */
<include refid="utility.paging-prefix"/>
SELECT MSG_KEY
, SUB_ID
, USER_KEY
, USER_GROUP
, USER_ID
, USER_JOBID
, CENTER_KEY
, MSG_PRIORITY
, MSG_STATE
, GET_CODE_NM('MSG001',MSG_STATE) AS MSG_STATE_NM
, INPUT_DATE
, INPUT_DT
, RES_DATE
, RES_DT
, QUE_DATE
, SENT_DATE
, RSLT_DATE
, REPORT_DATE
, RSLT_CODE
, RSLT_NET
, RSLT_TYPE
, SENT_COUNT
, HISTORY_MSG_TYPE
, HISTORY_RSLT_CODE
, IDENTIFIER
, PHONE
, CALLBACK
, MSG_TYPE_1
, CONTENTS_TYPE_1
, QUE_DATE_1
, SENT_DATE_1
, MSG_TYPE_2
, CONTENTS_TYPE_2
, QUE_DATE_2
, SENT_DATE_2
, MSG_TYPE_3
, CONTENTS_TYPE_3
, QUE_DATE_3
, SENT_DATE_3
, XMS_RSLT_CODE
, XMS_RSLT_NET
, XMS_RSLT_DATE
, XMS_REPORT_DATE
, ALT_RSLT_CODE
, ALT_RSLT_NET
, ALT_RSLT_DATE
, ALT_REPORT_DATE
, RCS_RSLT_CODE
, RCS_RSLT_NET
, RCS_RSLT_DATE
, RCS_REPORT_DATE
, XMS_SUBJECT
, XMS_TEXT
, XMS_FILE_NAME_1
, XMS_FILE_NAME_2
, XMS_FILE_NAME_3
, ALT_COUNTRY_CODE
, ALT_SENDER_KEY
, ALT_TEMPLATE_CODE
, ALT_JSON
, RCS_BRAND_KEY
, RCS_MASSAGE_BASE_ID
, RCS_JSON
FROM NURI2_NRMSG_DATA
WHERE 1=1
AND INPUT_DT <![CDATA[>=]]> CONCAT(#{schInputYmdFrom},'000000')
AND INPUT_DT <![CDATA[<=]]> CONCAT(#{schInputYmdTo},'235959')
<include refid="utility.sortBy" />
<include refid="utility.paging-suffix"/>
</select>
<insert id="insert" parameterType="cokr.xit.fims.mngt.MsgEntity">
/* 문자전송 요청 등록(msgMapper.insert) */
INSERT
INTO NURI2_NRMSG_DATA (
SUB_ID
, USER_KEY, USER_GROUP, USER_ID, USER_JOBID
, INPUT_DATE <!-- 메시지 입력 일시 -->
, INPUT_DT <!-- 메시지 입력 일시(사용자정의컬럼) -->
, RES_DATE <!-- 메시지 예약 일시 -->
, RES_DT <!-- 메시지 예약 일시(사용자정의컬럼) -->
, IDENTIFIER
, PHONE, CALLBACK <!-- 수신번호,발신번호 -->
, MSG_TYPE_1, CONTENTS_TYPE_1
, MSG_TYPE_2, CONTENTS_TYPE_2
, MSG_TYPE_3, CONTENTS_TYPE_3
, XMS_SUBJECT
, XMS_TEXT
<if test="@org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(altSenderKey)">
, ALT_COUNTRY_CODE
, ALT_SENDER_KEY
, ALT_TEMPLATE_CODE
, ALT_JSON
</if>
<if test="@org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(rcsBrandKey)">
, RCS_BRAND_KEY
, RCS_MASSAGE_BASE_ID
, RCS_JSON
</if>
<!-- , CENTER_KEY, MSG_PRIORITY --><!-- 전송라인,우선순위 (추후 요구시 사용) -->
<!-- , MSG_STATE --><!-- 메시지 상태 값 -->
<!-- , QUE_DATE, SENT_DATE, RSLT_DATE, REPORT_DATE -->
<!-- , RSLT_CODE, RSLT_NET, RSLT_TYPE, SENT_COUNT, HISTORY_MSG_TYPE, HISTORY_RSLT_CODE -->
<!-- , QUE_DATE_1, SENT_DATE_1 -->
<!-- , QUE_DATE_2, SENT_DATE_2 -->
<!-- , QUE_DATE_3, SENT_DATE_3 -->
<!-- , XMS_RSLT_CODE, XMS_RSLT_NET, XMS_RSLT_DATE, XMS_REPORT_DATE -->
<!-- , ALT_RSLT_CODE, ALT_RSLT_NET, ALT_RSLT_DATE, ALT_REPORT_DATE -->
<!-- , RCS_RSLT_CODE, RCS_RSLT_NET, RCS_RSLT_DATE, RCS_REPORT_DATE -->
<!-- , XMS_FILE_NAME_1, XMS_FILE_NAME_2, XMS_FILE_NAME_3 -->
)
VALUES (
#{subId}
, #{userKey}, #{userGroup}, #{userId}, #{userJobid}
, CURRENT_TIMESTAMP <!-- 메시지 입력 일시 -->
, <include refid="utility.now"/> <!-- 메시지 입력 일시(사용자정의컬럼) -->
<if test="resDate == null">
, CURRENT_TIMESTAMP <!-- 메시지 예약 일시 -->
, <include refid="utility.now"/> <!-- 메시지 예약 일시(사용자정의컬럼) -->
</if>
<if test="resDate != null">
<if test="_databaseId == 'mariadb'">
, STR_TO_DATE(#{resDate},'%Y%m%d%H%i%s') <!-- 메시지 예약 일시 -->
</if>
<if test="_databaseId == 'oracle'">
, TO_DATE(#{resDate},'YYYYMMDDHH24MISS') <!-- 메시지 예약 일시 -->
</if>
, #{resDate} <!-- 메시지 예약 일시(사용자정의컬럼) -->
</if>
, #{identifier}
, #{phone}, #{callback} <!-- 수신번호,발신번호 -->
, #{msgType1}, #{contentsType1}
, #{msgType2}, #{contentsType2}
, #{msgType3}, #{contentsType3}
, #{xmsSubject}
, #{xmsText}
<if test="@org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(altSenderKey)">
, '82'
, #{altSenderKey}
, #{altTemplateCode}
, #{altJson}
</if>
<if test="@org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(rcsBrandKey)">
, #{rcsBrandKey}
, #{rcsMassageBaseId}
, #{rcsJson}
</if>
<!-- , #{centerKey}, #{msgPriority} --><!-- 전송라인,우선순위 (추후 요구시 사용) -->
<!-- , #{msgState} --><!-- 메시지 상태 값 -->
<!-- , #{queDate}, #{sentDate}, #{rsltDate}, #{reportDate} -->
<!-- , #{rsltCode}, #{rsltNet}, #{rsltType}, #{sentCount}, #{historyMsgType}, #{historyRsltCode} -->
<!-- , #{queDate1}, #{sentDate1} -->
<!-- , #{queDate2}, #{sentDate2} -->
<!-- , #{queDate3}, #{sentDate3} -->
<!-- , #{xmsRsltCode}, #{xmsRsltNet}, #{xmsRsltDate}, #{xmsReportDate} -->
<!-- , #{altRsltCode}, #{altRsltNet}, #{altRsltDate}, #{altReportDate} -->
<!-- , #{rcsRsltCode}, #{rcsRsltNet}, #{rcsRsltDate}, #{rcsReportDate} -->
<!-- , #{xmsFileName1}, #{xmsFileName2}, #{xmsFileName3} -->
)
</insert>
<select id="selectStng" parameterType="cokr.xit.fims.mngt.MsgQuery">
/* 문자전송 설정 정보 조회(msgMapper.selectStng) */
SELECT MSG_STNG_ID
, SGG_CD
, STNG_INFO_TYPE
, TASK_TYPE
, TASK_SE_CD
, MODULE_ID
, TELNO
, SVC_TYPE
, SVC_USER_ID
, TMPLAT_ID
, TMPLT_CN
, USE_YN
FROM TB_MSG_STNG
WHERE STNG_INFO_TYPE = #{stngInfoType}
AND USE_YN = 'Y'
<if test="sggCd != null">
AND SGG_CD = #{sggCd}
</if>
</select>
</mapper>
Loading…
Cancel
Save