홈메이드 이유식 커밋

dev_bert
jeongcheewoo 3 years ago
parent a5c807420d
commit 5e927c4c89

@ -31,6 +31,11 @@ public interface M_Bf_foodBO {
public abstract List<DataMap> select_db_lac_commerce_list(DataMap paramMap) throws Exception;
public abstract int delete_bf_lac_commerce_single(DataMap paramMap) throws Exception;
public abstract Object insert_bf_home(DataMap paramMap) throws Exception;
public abstract int select_db_lac_home_list_count(DataMap paramMap) throws Exception;
public abstract List<DataMap> select_db_lac_home_list(DataMap paramMap) throws Exception;
public abstract int delete_bf_lac_home_single(DataMap paramMap) throws Exception;
public abstract int select_db_lac_milk_list_count(DataMap paramMap) throws Exception;
public abstract List<DataMap> select_db_lac_milk_list(DataMap paramMap) throws Exception;
public abstract Object insert_lac_milk(DataMap paramMap) throws Exception;

@ -316,4 +316,67 @@ public class M_Bf_foodBOImpl extends AbstractBOManager implements M_Bf_foodBO {
return result;
}
public int select_db_lac_home_list_count(DataMap paramMap) throws Exception{
int result = 0;
try {
generalDAO.setNamespace(SQLMAP_NAMESPACE);
result = generalDAO.select_item_to_number("select_lac_commerce_list_count", paramMap);
} catch (SQLException e) {
throw e;
}
return result;
}
public List<DataMap> select_db_lac_home_list(DataMap paramMap) throws Exception{
List<DataMap> lm = null;
try {
generalDAO.setNamespace(SQLMAP_NAMESPACE);
lm = generalDAO.select_to_list("select_lac_commerce_list", paramMap);
} catch (SQLException e) {
throw e;
}
return lm;
}
public Object insert_bf_home(DataMap paramMap) throws Exception{
Object resultObj = null;
try {
generalDAO.setNamespace(SQLMAP_NAMESPACE);
generalDAO.startTransaction();
resultObj = generalDAO.insert("insert_bf_commerce", paramMap);
generalDAO.commitTransaction();
} catch (SQLException e) {
throw e;
}finally{
generalDAO.endTransaction();
}
return resultObj;
}
public int delete_bf_lac_home_single(DataMap paramMap) throws Exception{
int result = 0;
try {
generalDAO.setNamespace(SQLMAP_NAMESPACE);
generalDAO.startTransaction();
result = generalDAO.delete("delete_lac_commerce_single", paramMap);
generalDAO.commitTransaction();
} catch (SQLException e) {
throw e;
}finally{
generalDAO.endTransaction();
}
return result;
}
}

@ -1323,4 +1323,39 @@ public class M_Bf_foodController extends AbstractControllerManager{
return redirect_url;
}
@RequestMapping(value="ajax_insert_home", method=RequestMethod.POST)
@ResponseBody
public HashMap<String, Object> ajax_insert_home(@ModelAttribute("model") ModelMap model, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
HttpSession session = request.getSession(false);
DataMap rm_mem = (DataMap) session.getAttribute(ConstantSystem.SESSION_RM_MEMBER);
DataMap paramMap = gmUtil.getDataMapFromRequest(request);
HashMap<String, Object> result = new HashMap<String, Object>();
result.put("RESULT", ConstantResultCode.RESULT_INIT);
try {
String smc_no = paramMap.getString("smc_no");
if(RenaStringUtil.isNullOrEmpty(smc_no)) {
result.put("RESULT", ConstantResultCode.RESULT_NEED_PARAMS);
}else {
String base_dt = RenaStringUtil.getData(paramMap, "base_dt");
if(RenaStringUtil.isNullOrEmpty(base_dt)) paramMap.put("base_dt", DateUtil.getDateString(DateUtil.F_YYYYMMDDDash));
//paramMap.put("weight", 0);
paramMap.put("member_id", RenaStringUtil.getData(rm_mem, "member_id"));
if(RenaStringUtil.isNullOrEmpty(RenaStringUtil.getData(paramMap, "data_from")) == true) paramMap.put("data_from", "1"); // 0 자동, 1 수기 입력
bf_foodBO.insert_bf_home(paramMap);
result.put("RESULT", ConstantResultCode.RESULT_SUCCESS);
}
} catch (Exception ex1) {
ex1.printStackTrace();
result.put("RESULT", ConstantResultCode.RESULT_EXCEPTION);
result.put("msg", ex1.getMessage());
}
return result;
}
}

Loading…
Cancel
Save