From 027049be07298b90f76ac2dcbbe0b09a1d975764 Mon Sep 17 00:00:00 2001 From: leebj Date: Wed, 6 Nov 2024 10:16:49 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=8A=A4=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/mngt/dao/MsgMapper.java | 4 +- .../xit/fims/mngt/service/MsgService.java | 5 +- .../xit/fims/mngt/service/bean/MsgBean.java | 9 +- .../mngt/service/bean/MsgServiceBean.java | 23 ++- .../xit/fims/mngt/web/Mngt03Controller.java | 17 +- .../sql/mapper/fims/mngt/msg-mapper.xml | 150 +++++++++--------- 6 files changed, 119 insertions(+), 89 deletions(-) diff --git a/src/main/java/cokr/xit/fims/mngt/dao/MsgMapper.java b/src/main/java/cokr/xit/fims/mngt/dao/MsgMapper.java index 9a85dc16..cfed0354 100644 --- a/src/main/java/cokr/xit/fims/mngt/dao/MsgMapper.java +++ b/src/main/java/cokr/xit/fims/mngt/dao/MsgMapper.java @@ -12,8 +12,8 @@ import cokr.xit.foundation.data.DataObject; @Mapper("msgMapper") public interface MsgMapper extends AbstractMapper { - int insert(MsgEntity msgEntity); - List selectList(MsgQuery msgQuery); + int insert(MsgEntity msgEntity); + } diff --git a/src/main/java/cokr/xit/fims/mngt/service/MsgService.java b/src/main/java/cokr/xit/fims/mngt/service/MsgService.java index bb7f514a..f4579126 100644 --- a/src/main/java/cokr/xit/fims/mngt/service/MsgService.java +++ b/src/main/java/cokr/xit/fims/mngt/service/MsgService.java @@ -1,6 +1,7 @@ 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; @@ -9,8 +10,8 @@ import cokr.xit.foundation.data.DataObject; public interface MsgService { - void regist(MsgEntity msgEntity); - List getList(MsgQuery msgQuery); + Map regist(List msgEntity); + } diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/MsgBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/MsgBean.java index 2621ca16..812939ae 100644 --- a/src/main/java/cokr/xit/fims/mngt/service/bean/MsgBean.java +++ b/src/main/java/cokr/xit/fims/mngt/service/bean/MsgBean.java @@ -18,10 +18,6 @@ public class MsgBean extends AbstractBean { @Resource(name="msgMapper") private MsgMapper msgMapper; - public void regist(MsgEntity msgEntity) { - msgMapper.insert(msgEntity); - } - public List getList(MsgQuery msgQuery) { if(ifEmpty(msgQuery.getOrderBy(), ()->"").equals("")) { msgQuery.setOrderBy("MSG_KEY"); @@ -29,4 +25,9 @@ public class MsgBean extends AbstractBean { return msgMapper.selectList(msgQuery); } + public boolean regist(MsgEntity msgEntity) { + int result = msgMapper.insert(msgEntity); + return result == 1 ? true : false; + } + } diff --git a/src/main/java/cokr/xit/fims/mngt/service/bean/MsgServiceBean.java b/src/main/java/cokr/xit/fims/mngt/service/bean/MsgServiceBean.java index 0f0c0673..a45c273e 100644 --- a/src/main/java/cokr/xit/fims/mngt/service/bean/MsgServiceBean.java +++ b/src/main/java/cokr/xit/fims/mngt/service/bean/MsgServiceBean.java @@ -1,6 +1,9 @@ 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; @@ -19,13 +22,25 @@ public class MsgServiceBean extends AbstractServiceBean implements MsgService { private MsgBean msgBean; @Override - public void regist(MsgEntity msgEntity) { - msgBean.regist(msgEntity); + public List getList(MsgQuery msgQuery) { + return msgBean.getList(msgQuery); } @Override - public List getList(MsgQuery msgQuery) { - return msgBean.getList(msgQuery); + public Map regist(List msgEntityList) { + Map resultMap = new HashMap(); + + List successList = new ArrayList(); + List failList = new ArrayList(); + + for(MsgEntity msgEntity : msgEntityList) { + + } + + resultMap.put("successList", successList); + resultMap.put("failList", failList); + + return resultMap; } } diff --git a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java index e6fc9e52..90816a16 100644 --- a/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java +++ b/src/main/java/cokr/xit/fims/mngt/web/Mngt03Controller.java @@ -1,18 +1,22 @@ package cokr.xit.fims.mngt.web; +import java.util.ArrayList; import java.util.List; +import java.util.Map; import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; +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.service.MsgService; import cokr.xit.foundation.data.DataObject; +import net.minidev.json.JSONObject; @Controller @RequestMapping(name="문자전송 관리", value=Mngt03Controller.CLASS_URL) @@ -50,11 +54,20 @@ public class Mngt03Controller extends ApplicationController { } @RequestMapping(name="문자전송 요청 등록", value=METHOD_URL.regist) - public ModelAndView regist(HttpServletRequest req, DataObject spec) { + public ModelAndView regist(@RequestBody JSONObject spec) { ModelAndView mav = new ModelAndView("jsonView"); + List msgEntityList = new ArrayList(); + // + MsgEntity msgEntity = new MsgEntity(); + msgEntityList.add(msgEntity); + // + Map resultMap = msgService.regist(msgEntityList); + + mav.addObject("resultMap", resultMap); + mav.addObject("saved",true); return mav; } } diff --git a/src/main/resources/sql/mapper/fims/mngt/msg-mapper.xml b/src/main/resources/sql/mapper/fims/mngt/msg-mapper.xml index 45d68c83..f6bc9b52 100644 --- a/src/main/resources/sql/mapper/fims/mngt/msg-mapper.xml +++ b/src/main/resources/sql/mapper/fims/mngt/msg-mapper.xml @@ -2,10 +2,82 @@ + + /* 문자전송 요청 등록(msgMapper.insert) */ INSERT - INTO NRMSG_DATA ( + INTO NURI2_NRMSG_DATA ( MSG_KEY , MSG_SUB_ID , USER_KEY @@ -69,7 +141,7 @@ INSERT , RCS_JSON ) VALUES ( - NRMSG_DATA_SEQ.NEXTVAL + nextval_msg() , #{msgSubId} , #{userKey} , #{userGroup} @@ -80,7 +152,7 @@ VALUES ( , #{msgState} , CURRENT_TIMESTAMP , - , #{resDate} + , CURRENT_TIMESTAMP , #{queDate} , #{sentDate} , #{rsltDate} @@ -133,76 +205,4 @@ VALUES ( ) - - \ No newline at end of file