Merge branch 'devs' of https://gitlab.com/big.imcloud/badyfeed/bf into devs
commit
2845573e83
@ -0,0 +1,22 @@
|
||||
package com.backoffice.m.bf_bottle;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.renastudio.creative.web.util.DataMap;
|
||||
|
||||
/**
|
||||
* @author renamaestro
|
||||
*/
|
||||
|
||||
public interface M_Bf_bottleBO {
|
||||
|
||||
public abstract int select_tbl_cart_check(DataMap paramMap) throws Exception;
|
||||
public abstract Object insert_tbl_cart(DataMap paramMap) throws Exception;
|
||||
public abstract int delete_tbl_cart_single(DataMap paramMap) throws Exception;
|
||||
|
||||
public abstract DataMap select_db_test_milk_input(DataMap paramMap) throws Exception;
|
||||
|
||||
|
||||
public abstract int select_db_test_milk_input_list_count(DataMap paramMap) throws Exception;
|
||||
public abstract List<DataMap> select_db_test_milk_input_list(DataMap paramMap) throws Exception;
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package com.backoffice.m.bf_bottle;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.renastudio.creative.web.util.AbstractBOManager;
|
||||
import com.renastudio.creative.web.util.DataMap;
|
||||
|
||||
/**
|
||||
* @author renamaestro
|
||||
*/
|
||||
|
||||
public class M_Bf_bottleBOImpl extends AbstractBOManager implements M_Bf_bottleBO {
|
||||
private static Log log = LogFactory.getLog(M_Bf_bottleBOImpl.class);
|
||||
|
||||
private final static String SQLMAP_NAMESPACE = "com.backoffice.m.bf_bottle.";
|
||||
|
||||
public Object insert_tbl_cart(DataMap paramMap) throws Exception{
|
||||
Object resultObj = null;
|
||||
|
||||
try {
|
||||
generalDAO.setNamespace(SQLMAP_NAMESPACE);
|
||||
generalDAO.startTransaction();
|
||||
|
||||
resultObj = generalDAO.insert("insert_tbl_cart", paramMap);
|
||||
|
||||
generalDAO.commitTransaction();
|
||||
} catch (SQLException e) {
|
||||
throw e;
|
||||
}finally{
|
||||
generalDAO.endTransaction();
|
||||
}
|
||||
|
||||
return resultObj;
|
||||
}
|
||||
|
||||
public int select_tbl_cart_check(DataMap paramMap) throws Exception{
|
||||
int result = 0;
|
||||
|
||||
try {
|
||||
generalDAO.setNamespace(SQLMAP_NAMESPACE);
|
||||
result = generalDAO.select_item_to_number("select_tbl_cart_check", paramMap);
|
||||
} catch (SQLException e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public int delete_tbl_cart_single(DataMap paramMap) throws Exception{
|
||||
int result = 0;
|
||||
|
||||
try {
|
||||
generalDAO.setNamespace(SQLMAP_NAMESPACE);
|
||||
result = generalDAO.delete("delete_tbl_cart_single", paramMap);
|
||||
} catch (SQLException e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public DataMap select_db_test_milk_input(DataMap paramMap) throws Exception{
|
||||
DataMap rm = null;
|
||||
|
||||
try {
|
||||
generalDAO.setNamespace(SQLMAP_NAMESPACE);
|
||||
rm = generalDAO.select_item_to_datamap("select_db_test_milk_input", paramMap);
|
||||
} catch (SQLException e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
return rm;
|
||||
}
|
||||
|
||||
public int select_db_test_milk_input_list_count(DataMap paramMap) throws Exception{
|
||||
int result = 0;
|
||||
|
||||
try {
|
||||
generalDAO.setNamespace(SQLMAP_NAMESPACE);
|
||||
result = generalDAO.select_item_to_number("select_db_test_milk_input_list_count", paramMap);
|
||||
} catch (SQLException e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public List<DataMap> select_db_test_milk_input_list(DataMap paramMap) throws Exception{
|
||||
List<DataMap> lm = null;
|
||||
|
||||
try {
|
||||
generalDAO.setNamespace(SQLMAP_NAMESPACE);
|
||||
lm = generalDAO.select_to_list("select_db_test_milk_input_list", paramMap);
|
||||
} catch (SQLException e) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
return lm;
|
||||
}
|
||||
}
|
@ -0,0 +1,131 @@
|
||||
package com.backoffice.m.bf_bottle;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
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.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.backoffice.constants.ConstantCode;
|
||||
import com.backoffice.constants.ConstantResultCode;
|
||||
import com.backoffice.constants.ConstantSystem;
|
||||
import com.backoffice.m.util.M_Util;
|
||||
import com.renastudio.creative.web.util.AbstractControllerManager;
|
||||
import com.renastudio.creative.web.util.DataMap;
|
||||
import com.renastudio.creative.web.util.RenaStringUtil;
|
||||
|
||||
/**
|
||||
* @author renamaestro
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value="m/bf_bottle/*")
|
||||
public class M_Bf_bottleController extends AbstractControllerManager{
|
||||
private static Log log = LogFactory.getLog(M_Bf_bottleController.class);
|
||||
|
||||
private final String REQUEST_MAPPING = "m/bf_bottle/";
|
||||
|
||||
@Autowired M_Bf_bottleBO bf_bottleBO;
|
||||
|
||||
|
||||
// paging info
|
||||
int ROW_COUNT = 20;
|
||||
int PAGE_COUNT = 10;
|
||||
|
||||
M_Util gmUtil = new M_Util();
|
||||
|
||||
|
||||
@RequestMapping(value="ajax_insert_bottle", method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public HashMap<String, Object> ajax_insert_bottle(@ModelAttribute("model") ModelMap model, HttpServletRequest request, HttpServletResponse response
|
||||
, RedirectAttributes redirectAttributes) {
|
||||
DataMap paramMap = gmUtil.getDataMapFromRequest(request);
|
||||
HashMap<String, Object> result = new HashMap<String, Object>();
|
||||
result.put("RESULT", ConstantResultCode.RESULT_INIT);
|
||||
|
||||
try {
|
||||
boolean is_login = gmUtil.setSessionForMobileMember(request, paramMap);
|
||||
if(is_login == false) {
|
||||
result.put("RESULT", ConstantResultCode.RESULT_SESSION_OUT);
|
||||
//int cart_check = bf_bottleBO.select_tbl_cart_check(paramMap);
|
||||
String res = String.valueOf(bf_bottleBO.insert_tbl_cart(paramMap));
|
||||
if(!RenaStringUtil.isNullOrEmpty(res))
|
||||
result.put("RESULT", 1);
|
||||
}
|
||||
} catch (Exception ex1) {
|
||||
ex1.printStackTrace();
|
||||
result.put("RESULT", ConstantResultCode.RESULT_EXCEPTION);
|
||||
result.put("msg", ex1.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequestMapping(value="list_db_test_milk_input")
|
||||
public String list_db_test_milk_input(@ModelAttribute("model") ModelMap model, HttpServletRequest request, HttpServletResponse response
|
||||
, RedirectAttributes ra) {
|
||||
|
||||
DataMap paramMap = this.getDataMapFromRequest(request);
|
||||
|
||||
checkHeaderParam(AbstractControllerManager.CHECK_NORMAL, paramMap);
|
||||
|
||||
DataMap map_auth = check_auth(ConstantCode.AUTH_LIST, REQUEST_MAPPING, ConstantSystem.SESSION_CACHE_MENU, request);
|
||||
if(map_auth != null){
|
||||
model.addAttribute("map_auth", map_auth);
|
||||
|
||||
String redirect_url = "admin/bf/db_test_milk_input/list_db_test_milk_input";
|
||||
|
||||
if(ConstantCode.isAuth(map_auth, ConstantCode.AUTH_R) == false){
|
||||
redirect_url = "admin/view_no_auth";
|
||||
}else{
|
||||
|
||||
String check_sys_member_id = this.getSystemLoginId(request, ConstantSystem.SESSION_SYS_MEMBER, paramMap, ConstantSystem.SESSION_SYS_MEMBER);
|
||||
|
||||
if(RenaStringUtil.isNullOrEmpty(check_sys_member_id) == false){
|
||||
|
||||
try{
|
||||
if(RenaStringUtil.isNullOrEmpty(paramMap, "rowCount") == false) ROW_COUNT = RenaStringUtil.getDataToInt(paramMap, "rowCount");
|
||||
|
||||
int rowMax = bf_bottleBO.select_db_test_milk_input_list_count(paramMap);
|
||||
initPage(paramMap, ROW_COUNT, PAGE_COUNT, rowMax); // check page count
|
||||
|
||||
List<DataMap> lm = bf_bottleBO.select_db_test_milk_input_list(paramMap);
|
||||
DataMap.putToModel(model, "lm", lm);
|
||||
|
||||
}catch(Exception ex1){
|
||||
ex1.printStackTrace();
|
||||
|
||||
DataMap errorMap = new DataMap();
|
||||
String servletPath = request.getServletPath();
|
||||
errorMap.put("servletPath", servletPath);
|
||||
errorMap.put("paramMap", RenaStringUtil.getJSONFromMap(paramMap));
|
||||
errorMap.put("ERROR_MSG", "" + ex1);
|
||||
|
||||
this.redirectParam(ra, errorMap);
|
||||
redirect_url = "redirect:/admin/error/view_error.do";
|
||||
}
|
||||
}else{
|
||||
redirect_url = "admin/view_no_auth";
|
||||
}
|
||||
|
||||
this.redirectParam(model, paramMap);
|
||||
}
|
||||
|
||||
return redirect_url;
|
||||
}else{
|
||||
return "admin/view_no_auth";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||
<sqlMap namespace="com.backoffice.m.bf_bottle">
|
||||
|
||||
<insert id="insert_tbl_cart" parameterClass="dataMap">
|
||||
INSERT tbl_cart
|
||||
(
|
||||
reg_dt
|
||||
,member_id
|
||||
,title
|
||||
<isNotEmpty property="di_no">,di_no</isNotEmpty>
|
||||
<isNotEmpty property="dbi_no">,dbi_no</isNotEmpty>
|
||||
<isNotEmpty property="dbc_no">,dbc_no</isNotEmpty>
|
||||
) VALUES (
|
||||
NOW()
|
||||
,#member_id#
|
||||
,#title#
|
||||
<isNotEmpty property="di_no">,#di_no#</isNotEmpty>
|
||||
<isNotEmpty property="dbi_no">,#dbi_no#</isNotEmpty>
|
||||
<isNotEmpty property="dbc_no">,#dbc_no#</isNotEmpty>
|
||||
)
|
||||
|
||||
<selectKey resultClass="Integer" keyProperty="primaryKey">
|
||||
SELECT LAST_INSERT_ID();
|
||||
</selectKey>
|
||||
</insert>
|
||||
|
||||
</sqlMap>
|
@ -0,0 +1,79 @@
|
||||
<#include "/m/include/index_top.ftl">
|
||||
|
||||
<link rel="stylesheet" href="${URL_STATIC_ROOT}/m/css/swiper.min.css">
|
||||
<script src="${URL_STATIC_ROOT}/m/js/swiper.min.js"></script>
|
||||
<script src="${URL_STATIC_ROOT}/m/js/jquery_popupoverlay.js"></script>
|
||||
<script src="${URL_STATIC_ROOT}/m/js/design.js"></script>
|
||||
|
||||
<body class="bg_nutrition">
|
||||
|
||||
<!-- wrap -->
|
||||
<div class="wrap">
|
||||
|
||||
<!-- header_sub -->
|
||||
<header class="header_wrapper">
|
||||
<a href="javascript:back.return_url();" class="side_Lbtn hidden pre_btn">이전으로</a>
|
||||
<h1 class="header_title">모유/젖병</h1>
|
||||
<div class="side_Rbtn">
|
||||
</div>
|
||||
</header>
|
||||
<!-- //header_sub -->
|
||||
|
||||
<!-- main_nutrition -->
|
||||
<main class="main_nutrition">
|
||||
|
||||
<!-- nutrition_search_main -->
|
||||
<div class="nutrition_search_main">
|
||||
|
||||
<div class="cart_list_btn">
|
||||
<a href="#" id="save">저장</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- //nutrition_search_main -->
|
||||
|
||||
</main>
|
||||
<!-- //main_nutrition -->
|
||||
|
||||
</div>
|
||||
<!-- //wrap -->
|
||||
|
||||
<!-- 하단 네비 iyu_nav -->
|
||||
<#include "/m/include/index_bottom_menu.ftl">
|
||||
<!-- //iyu_nav -->
|
||||
|
||||
<#include "/m/bf_food/include_return_url.ftl">
|
||||
|
||||
</body>
|
||||
<#include "/m/include/index_bottom.ftl">
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
$(function() { //전체선택 체크박스 클릭
|
||||
$("#save").click(function() {
|
||||
debugger;
|
||||
$.ajax({
|
||||
url:'${URL_ROOT}/m/bf_bottle/ajax_insert_bottle.do',
|
||||
type:'post',
|
||||
data:{
|
||||
"dbi_no":'84',
|
||||
"title": '테스트 타이틀 입니다.',
|
||||
"member_id":'${model['member_id']!}'
|
||||
},
|
||||
dataType:'json',
|
||||
error:function(request,status,error){
|
||||
},
|
||||
success:function(result){
|
||||
if(result.RESULT==1)
|
||||
alert('카트에 분유수유가 추가되었습니다.');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</html>
|
Loading…
Reference in new issue