/** * 订单信息列表页面跳转 * * @return */ @RequestMapping(params = "addorupdateNoTag") public ModelAndView addorupdate(SbOrderMainEntity sbOrderMain, HttpServletRequest req) { if (StringUtil.isNotEmpty(sbOrderMain.getId())) { sbOrderMain = sbOrderMainService.getEntity(SbOrderMainEntity.class, sbOrderMain.getId()); req.setAttribute("sbOrderMainPage", sbOrderMain); } if (StringUtil.isNotEmpty(sbOrderMain.getGoOrderCode())) { List<SbOrderProductEntity> sbOrderProductEntityList = sbOrderMainService.findByProperty( SbOrderProductEntity.class, "goOrderCode", sbOrderMain.getGoOrderCode()); req.setAttribute("sbOrderProductList", sbOrderProductEntityList); } if (StringUtil.isNotEmpty(sbOrderMain.getGoOrderCode())) { List<SbOrderCustomEntity> sbSbOrderCustomEntityList = sbOrderMainService.findByProperty( SbOrderCustomEntity.class, "goOrderCode", sbOrderMain.getGoOrderCode()); req.setAttribute("sbOrderCustomList", sbSbOrderCustomEntityList); } return new ModelAndView("sb/demo/notag/sbOrderMainNoTag"); }
/** * 删除订单信息 * * @return */ @RequestMapping(params = "del") @ResponseBody public AjaxJson del(SbOrderMainEntity sbOrderMain, HttpServletRequest request) { AjaxJson j = new AjaxJson(); sbOrderMain = systemService.getEntity(SbOrderMainEntity.class, sbOrderMain.getId()); message = "删除成功"; sbOrderMainService.delMain(sbOrderMain); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); j.setMessage(message); return j; }
/** * 添加订单及明细信息 * * @param ids * @return */ @RequestMapping(params = "save") @ResponseBody public AjaxJson save( SbOrderMainEntity sbOrderMain, SbOrderMainPage sbOrderMainPage, HttpServletRequest request) { List<SbOrderProductEntity> sbOrderProducList = sbOrderMainPage.getSbOrderProductList(); List<SbOrderCustomEntity> sbOrderCustomList = sbOrderMainPage.getSbOrderCustomList(); Boolean sbOrderCustomShow = "true".equals(request.getParameter("sbOrderCustomShow")); AjaxJson j = new AjaxJson(); if (StringUtil.isNotEmpty(sbOrderMain.getId())) { message = "更新成功"; sbOrderMainService.updateMain( sbOrderMain, sbOrderProducList, sbOrderCustomList, sbOrderCustomShow); systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); } else { message = "添加成功"; sbOrderMainService.addMain(sbOrderMain, sbOrderProducList, sbOrderCustomList); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); } j.setMessage(message); return j; }