소스 정리

main
이범준 1 week ago
parent e392ae92a9
commit 027049be07

@ -12,8 +12,8 @@ import cokr.xit.foundation.data.DataObject;
@Mapper("msgMapper")
public interface MsgMapper extends AbstractMapper {
int insert(MsgEntity msgEntity);
List<DataObject> selectList(MsgQuery msgQuery);
int insert(MsgEntity msgEntity);
}

@ -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<DataObject> getList(MsgQuery msgQuery);
Map<String,Object> regist(List<MsgEntity> msgEntity);
}

@ -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<DataObject> 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;
}
}

@ -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<DataObject> getList(MsgQuery msgQuery) {
return msgBean.getList(msgQuery);
}
@Override
public List<DataObject> getList(MsgQuery msgQuery) {
return msgBean.getList(msgQuery);
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>();
for(MsgEntity msgEntity : msgEntityList) {
}
resultMap.put("successList", successList);
resultMap.put("failList", failList);
return resultMap;
}
}

@ -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<MsgEntity> msgEntityList = new ArrayList<MsgEntity>();
//
MsgEntity msgEntity = new MsgEntity();
msgEntityList.add(msgEntity);
//
Map<String,Object> resultMap = msgService.regist(msgEntityList);
mav.addObject("resultMap", resultMap);
mav.addObject("saved",true);
return mav;
}
}

@ -2,10 +2,82 @@
<!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
, MSG_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
, RES_DATE
, 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 REG_YMD <![CDATA[>=]]> #{schInputDateFrom}
AND REG_YMD <![CDATA[<=]]> #{schInputDateTo}
<include refid="utility.sortBy" />
<include refid="utility.paging-suffix"/>
</select>
<insert id="insert" parameterType="cokr.xit.fims.mngt.MsgEntity">
/* 문자전송 요청 등록(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
, <include refid="utility.today"/>
, #{resDate}
, CURRENT_TIMESTAMP
, #{queDate}
, #{sentDate}
, #{rsltDate}
@ -133,76 +205,4 @@ VALUES (
)
</insert>
<select id="selectList" parameterType="cokr.xit.fims.mngt.MsgQuery" resultType="dataObject">
/* 문자전송 목록(msgMapper.selectList) */
<include refid="utility.paging-prefix"/>
SELECT MSG_KEY
, MSG_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
, RES_DATE
, 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 NRMSG_DATA
WHERE 1=1
AND REG_YMD <![CDATA[>=]]> #{schInputDateFrom}
AND REG_YMD <![CDATA[<=]]> #{schInputDateTo}
<include refid="utility.sortBy" />
<include refid="utility.paging-suffix"/>
</select>
</mapper>
Loading…
Cancel
Save