/** * 订单跟踪信息列表页面跳转 * * @return */ @RequestMapping(params = "addorupdate") public ModelAndView addorupdate(TbOrderTrackingEntity tbOrderTracking, HttpServletRequest req) { if (StringUtil.isNotEmpty(tbOrderTracking.getId())) { tbOrderTracking = tbOrderTrackingService.getEntity(TbOrderTrackingEntity.class, tbOrderTracking.getId()); req.setAttribute("tbOrderTrackingPage", tbOrderTracking); } return new ModelAndView("jeecg/test/orders/tbOrderTracking"); }
/** * easyui AJAX请求数据 * * @param request * @param response * @param dataGrid * @param user */ @RequestMapping(params = "datagrid") public void datagrid( TbOrderTrackingEntity tbOrderTracking, HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { CriteriaQuery cq = new CriteriaQuery(TbOrderTrackingEntity.class, dataGrid); // 查询条件组装器 org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, tbOrderTracking); // System.out.println("tbOrderTrackIng:"+tbOrderTracking.getId()); if (null != tbOrderTracking.getOrderId() && !"".equals(tbOrderTracking.getOrderId()) && null != tbOrderTracking.getOrderId().getId()) { cq.createAlias("orderId", "tbOrders"); cq.eq("orderId.id", tbOrderTracking.getOrderId().getId()); cq.add(); } this.tbOrderTrackingService.getDataGridReturn(cq, true); TagUtil.datagrid(response, dataGrid); }
/** * 删除订单跟踪信息 * * @return */ @RequestMapping(params = "del") @ResponseBody public AjaxJson del(TbOrderTrackingEntity tbOrderTracking, HttpServletRequest request) { AjaxJson j = new AjaxJson(); tbOrderTracking = systemService.getEntity(TbOrderTrackingEntity.class, tbOrderTracking.getId()); message = "删除成功"; tbOrderTrackingService.delete(tbOrderTracking); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); j.setMsg(message); return j; }
/** * 添加订单跟踪信息 * * @param ids * @return */ @RequestMapping(params = "save") @ResponseBody public AjaxJson save(TbOrderTrackingEntity tbOrderTracking, HttpServletRequest request) { AjaxJson j = new AjaxJson(); if (StringUtil.isNotEmpty(tbOrderTracking.getId())) { message = "更新成功"; TbOrderTrackingEntity t = tbOrderTrackingService.get(TbOrderTrackingEntity.class, tbOrderTracking.getId()); try { MyBeanUtils.copyBeanNotNull2Bean(tbOrderTracking, t); tbOrderTrackingService.saveOrUpdate(t); systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); } catch (Exception e) { e.printStackTrace(); } } else { message = "添加成功"; tbOrderTrackingService.save(tbOrderTracking); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); } return j; }