- 浏览: 44402 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
dl96200:
辛苦了。。感谢感谢 啊
dom读取xml与写入xml -
kaven1989:
太好了,楼主辛苦了
dom读取xml与写入xml -
osacar:
效果如何?性能?
java 生成缩略图
jsp页面
Controller层
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %> <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <c:set scope="request" var="sysModule" value="product" /> <c:set scope="request" var="sysPage" value="allocate_order" /> <c:set var="pageTitle" value="${gto.id == null?'添加调拨单':'编辑调拨单'}" /> <tiles:insertDefinition name="metronicTemplate"> <tiles:putAttribute name="title">${pageTitle }</tiles:putAttribute> <tiles:putAttribute name="page-content"> <div class="row"> <div class="col-md-12"> <div class="portlet light"> <div class="portlet-title"> <div class="caption"> <i class="fa fa-cogs font-green-sharp"></i> <span class="caption-subject font-green-sharp bold uppercase">${pageTitle }</span> </div> <div class="tools"> <a href="javascript:;" class="collapse"></a> </div> </div> <div class="portlet-body"> <%@include file="/WEB-INF/view/include/message.jsp" %> <form:form cssClass="form-horizontal" role="form" method="post" action="${pageContext.request.contextPath}/allocateOrder/save" id="io_order_form" modelAttribute="gto"> <input type="hidden" name="id" value="${gto.id }" /> <fieldset> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="control-label col-md-4">调拨单号</label> <div class="col-md-8"> <input type="text" readonly="readonly" class="form-control" name="orderNo" value="${gto.orderNo}"> </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="control-label col-md-4">调拨日期</label> <div class="col-md-8"> <div class="input-group date date-picker" data-date-format="yyyy-mm-dd"> <form:input path="transferDate" maxlength="10" cssClass="form-control" /> <span class="input-group-btn"> <button class="btn default" type="button"><i class="fa fa-calendar"></i></button> </span> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="control-label col-md-4">调拨出库日期</label> <div class="col-md-8"> <input type="text" class="form-control" readonly="readonly" value="<fmt:formatDate value="${gto.ocTime}" pattern="yyyy-MM-dd HH:mm:ss" />"> </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="control-label col-md-4">调拨入库日期</label> <div class="col-md-8"> <input type="text" class="form-control" readonly="readonly" value="<fmt:formatDate value="${gto.orTime}" pattern="yyyy-MM-dd HH:mm:ss" />"> </div> </div> </div> <div class="col-md-4"> <div class="form-group"> <label class="control-label col-md-4">备注</label> <div class="col-md-8"> <input type="text" class="form-control" name="note" id="note" value="${gto.note}"> </div> </div> </div> </div> </fieldset> <fieldset> <legend> 物品信息 <c:if test="${gto.status != 2}"> <button type="button" class="btn btn-primary" data-dismiss="alert" onclick="addEditRow();">添加</button> </c:if> </legend> <table class="table table-hover table-bordered table-condensed" id="IoOrder_add_table"> <thead> <tr id="info_tr"> <th>SKU</th> <th>名称</th> <th>库存</th> <th>锁定库存</th> <th>数量</th> <th>调出仓库</th> <th>调出货位</th> <th>调入仓库</th> <th>调入货位</th> <c:if test="${not empty gto.orTime}"> <th>实际入库数量</th> </c:if> <c:if test="${not empty gto.ocTime}"> <th>实际出库数量</th> </c:if> <th></th> </tr> </thead> <tbody id="info_tb"> <c:forEach items="${gto.items}" var="item" varStatus="status"> <tr> <td><input name="goodsSku" value="${item.goodsSku }" class="form-control input-sm" id="goodsSku_${status.index }" readonly="readonly" size="11" /></td> <td><input name="goodsName" value="${item.goodsName }" class="form-control input-sm" id="goodsName_${status.index }" readonly="readonly" /></td> <td><input name="inventory" value="" class="form-control input-sm" id="" readonly="readonly" size="5" /></td> <td><input name="inventoryLock" value="" class="form-control input-sm" id="" readonly="readonly" size="5" /></td> <td> <input name="goodsCount" value="${item.goodsCount }" class="form-control input-sm" id="goodsCount_${status.index }" size="5" /> </td> <!--start 出库 --> <td> <select class="form-control input-sm" name="fromStoreId" id="fromStoreId_${status.index }" shelfId="${item.fromStoreShelfId }"> <option value="">请选择...</option> <c:forEach var="ss" items="${store}"> <option value="${ss.id}" ${item.fromStoreId == ss.id ? 'selected' : '' }>${ss.name}</option> </c:forEach> </select> </td> <td> <input type="text" name="fromStoreShelf" value="${item.fromStoreShelf }" class="form-control input-sm" size="10" /> <input type="hidden" name="fromStoreShelfId" value="${item.fromStoreShelfId }" /> </td> <!-- end 出库 --> <!--start 入库 --> <td> <select class="form-control input-sm" name="toStoreId" id="toStoreId_${status.index }" shelfId="${item.toStoreShelfId }"> <option value="">请选择...</option> <c:forEach var="ss" items="${store}"> <option value="${ss.id}" ${item.toStoreId == ss.id ? 'selected' : '' }>${ss.name}</option> </c:forEach> </select> </td> <td> <input type="text" name="toStoreShelf" value="${item.toStoreShelf }" class="form-control input-sm" size="10" /> <input type="hidden" name="toStoreShelfId" value="${item.toStoreShelfId }" /> </td> <!--start 入库 --> <c:if test="${not empty gto.orTime }"> <td> <input type="text" value="${item.orNum }" class="form-control input-sm" size="10" /> </td> </c:if> <c:if test="${not empty gto.ocTime }"> <td> <input type="text" value="${item.ocNum }" class="form-control input-sm" size="10" /> </td> </c:if> <td> <c:if test="${gto.status != 2}"> <a href="javascript:;" class="btn default btn-xs black c-row-del-btns"> <i class="fa fa-trash-o"></i> <spring:message code="g.label.delete"/> </a> </c:if> </td> </tr> </c:forEach> </tbody> <tbody> <tr> <td> </td> <td> </td> <td> </td> <td class="text-right">总数量:</td> <td id="sum_count_td"> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td colspan="3"> </td> </tr> </tbody> </table> </fieldset> <fieldset> <legend>操作</legend> <c:if test="${gto.id != null }"> <div class="row"> <div class="col-md-12"> 制单时间: <fmt:formatDate value="${gto.createdTime}" pattern="yyyy-MM-dd HH:mm:ss" /> 制单人: ${gto.userName} </div> </div> <c:if test="${gto.status == 2 }"> <div class="row"> <div class="col-md-12"> 审核时间: <fmt:formatDate value="${gto.auditTime}" pattern="yyyy-MM-dd HH:mm:ss" /> 审核人: ${gto.auditUserName} </div> </div> </c:if> </c:if> <div class="row text-center"> <%-- 新建或者未审核时可保存 --%> <c:if test="${gto.id == null || gto.status == 1}"> <button type="submit" id="sub_id" class="btn btn-primary"><spring:message code="g.label.save"/></button> </c:if> <%-- 未审核才能审核 --%> <c:if test="${gto.id != null && gto.status == 1}"> <a href="${pageContext.request.contextPath }/allocateOrder/approve?id=${gto.id}" class="btn btn-primary c-confirm-link"><spring:message code="g.label.approved"/></a> </c:if> </div> </fieldset> </form:form> </div> </div> </div> </div> </tiles:putAttribute> <%-- 页面级别的 JS --%> <tiles:putAttribute name="js-page"> <script src="${pageContext.request.contextPath }/resources/assets/global/plugins/datatables/media/js/jquery.dataTables.min.js" type="text/javascript"></script> <script src="${pageContext.request.contextPath }/resources/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js" type="text/javascript"></script> <script src="${pageContext.request.contextPath }/resources/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script> <script> var trHtmlPattern = '<tr>' + ' <td><input name="goodsSku" class="form-control input-sm" id="goodsSku_{0}" size="11" /></td>'+ ' <td><input name="goodsName" class="form-control input-sm" id="goodsName_{0}" readonly="readonly" /></td>' + ' <td><input name="inventory" class="form-control input-sm" id="inventory_{0}" readonly="readonly" size="5" /></td>'+ ' <td><input name="inventoryLock" class="form-control input-sm" id="inventoryLock_{0}" readonly="readonly" size="5" /></td>'+ ' <td><input name="goodsCount" class="form-control input-sm" id="goodsCount_{0}" size="5" /></td>' + //出库 ' <td>' + ' <select class="form-control input-sm" name="fromStoreId" id="fromStoreId_{0}">' + ' <option value="">请选择...</option>' + ' <c:forEach var="ss" items="${store}">' + ' <option value="${ss.id}">${ss.name}</option>' + ' </c:forEach>' + ' </select>' + ' </td>' + ' <td>' + ' <input type="text" name="fromStoreShelf" id="fromStoreShelf_{0}" class="form-control input-sm" size="10" />' + ' <input type="hidden" name="fromStoreShelfId" id="fromStoreShelfId_{0}" value="${item.fromStoreShelfId }" />' + ' </td>' + //入库 ' <td>' + ' <select class="form-control input-sm" name="toStoreId" id="toStoreId_{0}">' + ' <option value="">请选择...</option>' + ' <c:forEach var="ss" items="${store}">' + ' <option value="${ss.id}">${ss.name}</option>' + ' </c:forEach>' + ' </select>' + ' </td>' + ' <td>' + ' <input type="text" name="toStoreShelf" id="toStoreShelf_{0}" class="form-control input-sm" size="10" />' + ' <input type="hidden" name="toStoreShelfId" id="toStoreShelfId_{0}" value="${item.toStoreShelfId }" />' + ' </td>' + ' <td>' + ' <a href="javascript:;" class="btn default btn-xs black c-row-del-btns">' + ' <i class="fa fa-trash-o"></i> <spring:message code="g.label.delete"/>' + ' </a>' + ' </td>' + '</tr>'; $(function() { $(document).on('blur', 'input[name=goodsSku]', function() { var $this = $(this); var sku = $.trim($this.val()); $this.val(sku); if (sku == '') return false; var skuCounter = 0; $('input[name=goodsSku]').each(function() { if ($(this).val() == sku) { skuCounter++; } }); if (skuCounter > 1) { alert('已经存在相同SKU行,请在同一行编辑'); $this.val(''); $this.blur(); return; } // 查询商品信息 $.get('${pageContext.request.contextPath }/goods/load-by-sku.json?sku=' + sku, function(goods) { if (goods == null) { $this.parents('tr').find('input[name=goodsName], input[name=goodsCost]').val(''); alert(sku + '不存在!') return; } var $tr = $this.closest('tr'); $tr.find('input[name=goodsName]').val(goods.name); $tr.find('select[name=fromStoreId]').val(goods.storeId); $tr.find('input[name=fromStoreShelfId]').val(goods.storeShelfId); $tr.find('input[name=fromStoreShelf]').val(goods.storeShelfCode); $.get('${pageContext.request.contextPath }/store/find-storeId-and-shelfCode-and-sku.json?code=' +goods.storeShelfCode+'&storeId='+goods.storeId+'&sku='+sku ,function(data){ $this.parents('tr').find('input[name=inventory]').val((data.inventory==null||data.inventory==''?0:data.inventory)); $this.parents('tr').find('input[name=inventoryLock]').val((data.inventoryLock==null||data.inventoryLock==''?0:data.inventoryLock)); },'json'); $($this.parents('tr').find('input[name=goodsCount]')).change(function(){ var $tr = $this.parents('tr'); var salecount = parseInt($tr.find('input[name=inventory]').val()) - parseInt($tr.find('input[name=inventoryLock]').val()); var goodsCount = $(this).val(); if(goodsCount > salecount){ alert("调拨数量不能大于可用数"); $this.focus(); $this.parents('tr').find('input[name=goodsCount]').val(''); return false; } }); }, 'json'); }); $(document).on('click', '.c-row-del-btns', function() { $(this).parents('tr').remove(); }); $('#io_order_form').validate({ errorElement : 'span', //default input error message container errorClass : 'help-block help-block-error', // default input error message class focusInvalid : false, // do not focus the last invalid input ignore : "", // validate all fields including form hidden input messages: { fromStoreShelfId: '必须输入或输入不正确', toStoreShelfId: '必须输入或输入不正确', goodsCount:{remote:"不能大于调拨数量"} }, rules : { transferDate : { required : true }, goodsSku : { required : true }, //goodsName : { required : true }, goodsCount : { required : true, digits: true, min : 1}, goodsCost : { required : true, number: true }, fromStoreId : { required : true }, fromStoreShelf : { required : true }, fromStoreShelfId : { required : true }, toStoreId : { required : true }, toStoreShelf: { required : true }, toStoreShelfId: { required : true } }, highlight : function(element) { // hightlight error inputs $(element).parent().addClass('has-error'); // set error class to the control group }, unhighlight : function(element) { // revert the change done by hightlight $(element).parent().removeClass('has-error'); // set error class to the control group }, success : function(label) { label.parent().removeClass('has-error'); // set success class to the control group } }); $('#io_order_form').submit(function() { if ($('input[name=goodsSku]').length == 0) { alert('请添加SKU信息'); return false; } var f=false; $('select[name=fromStoreId]').each(function(){ var $this = $(this); var fromStoreId=$this.val(); var toStoreId = $this.closest('tr').find('select[name=toStoreId]').val(); //alert(fromStoreId+"--------"+(toStoreId=="")); if(fromStoreId!=""&&fromStoreId==toStoreId){ f=true; $this.focus(); alert('调出仓库与调入仓库不能相同'); return false; } }); if(f){return false;} return true; }); $(document).on('change', 'select[name=fromStoreId]', function() { var $this = $(this); $tr = $this.closest('tr');console.log('$tr.length - ' + $tr.length); $tr.find('input[name=fromStoreShelf]').val(''); $tr.find('input[name=fromStoreShelfId]').val(''); }); $(document).on('change', 'select[name=toStoreId]', function() { var $this = $(this); $tr = $this.closest('tr');console.log('$tr.length - ' + $tr.length); $tr.find('input[name=toStoreShelf]').val(''); $tr.find('input[name=toStoreShelfId]').val(''); }); $(document).on('change','input[name=goodsCount]', function() { var $this = $(this); var $tr = $this.parents('tr'); var salecount = parseInt($tr.find('input[name=inventory]').val()) - parseInt($tr.find('input[name=inventoryLock]').val()); var goodsCount = $(this).val(); if(goodsCount > salecount){ alert("出货数不能大于可用数"); $this.focus(); $this.parents('tr').find('input[name=goodsCount]').val(''); return false; } }); $(document).on('change', 'input[name=goodsCount], input[name=goodsCost]', function() { sumCount(); }); //出库 $(document).on('change', 'input[name=fromStoreShelf]', function() { var $this = $(this); $this.siblings('input[name=fromStoreShelfId]').val(''); var fromStoreId = $this.closest('tr').find('select[name=fromStoreId]').val(); var goodsSku = $this.closest('tr').find('input[name=goodsSku]').val(); if (fromStoreId == '') { alert('请先选择出库仓库'); return; } var code = $.trim($this.val()); if (code == '') { return; } var url = '${pageContext.request.contextPath}/store/find-storeId-and-shelfCode-and-sku.json?code=' + code+'&storeId='+fromStoreId+'&sku='+goodsSku; $.getJSON(url).done(function(result){ console.log(result); var $storeShelfIdInput = $this.siblings('input[name=fromStoreShelfId]'); var inventory = $this.closest('tr').find('input[name=inventory]'); var inventoryLock = $this.closest('tr').find('input[name=inventoryLock]'); if (result == null) { $this.focus(); $storeShelfIdInput.val(''); alert('出库仓位号输入错误,请重新输入'); return; } if (fromStoreId == result.storeId) { $storeShelfIdInput.val(result.id); inventory.val((result.inventory==null||result.inventory==''?0:result.inventory)); inventoryLock.val((result.inventoryLock==null||result.inventoryLock==''?0:result.inventoryLock)); } else { $storeShelfIdInput.val(''); $this.val(''); alert('出库仓位号输入错误,请重新输入'); } }); }); //入库 $(document).on('change', 'input[name=toStoreShelf]', function() { var $this = $(this); $this.siblings('input[name=toStoreShelfId]').val(''); var toStoreId = $this.closest('tr').find('select[name=toStoreId]').val(); if (toStoreId == '') { alert('请先选择入库仓库'); return; } var code = $.trim($this.val()); if (code == '') { return; } var url = '${pageContext.request.contextPath}/store/find-StoreId-and-shelfCode.json?code=' + code+"&storeId="+toStoreId; $.getJSON(url).done(function(result){ console.log(result); var $storeShelfIdInput = $this.siblings('input[name=toStoreShelfId]'); if (result == null) { $this.focus(); $storeShelfIdInput.val(''); alert('入库仓位号输入错误,请重新输入'); return; } if (toStoreId == result.storeId) { $storeShelfIdInput.val(result.id); } else { $storeShelfIdInput.val(''); $this.val(''); alert('入库仓位号输入错误,请重新输入'); } }); }); }); var rowNum = 10000; function addEditRow() { rowNum ++; var html = trHtmlPattern.format(rowNum); $("#info_tb").append(html); } function subFrom(){ $('#io_order_form').submit(); } function dropHtml(rowNum) { $('#' + rowNum).remove(); } function requestShelfList($tr, selectedValue, shelfId) { $.get('${pageContext.request.contextPath }/store/shelf-json?id=' + selectedValue, function(data) { xfy.fillSelect($tr.find('select[name=storeShelfId]'), data, 'id', 'code'); if (shelfId != '') { $tr.find('select[name=fromStoreShelfId]').val(shelfId); } }, 'json'); } $('.date-picker').datepicker({ orientation: "right", autoclose: true }); function sumCount() { var sumCount = 0; $('input[name=goodsCount]').each(function() { var $this = $(this); var goodsCountStr = $.trim($this.val()); if (goodsCountStr == '') { return; } var goodsCountFloat = parseFloat(goodsCountStr); sumCount += goodsCountFloat; }); $('#sum_count_td').html(sumCount); } sumCount(); </script> </tiles:putAttribute> </tiles:insertDefinition>
Controller层
@RequestMapping("edit") public ModelAndView edit(@RequestParam(value="id", required=false) Long id){ ModelAndView mv = new ModelAndView(); GoodsTransferOrder gto=null; if (id != null) { gto=goodsTransferOrderService.get(id); List<GoodsTransferOrderItem> items=goodsTransferOrderItemDao.findItem(gto.getOrderNo()); gto.setItems(items); }else{ gto=new GoodsTransferOrder(); gto.setOrderNo(xxNoGenerateService.generate(XxNoType.DB)); } mv.addObject("gto",gto); List<Store> listStore = storeService.findStroe(); mv.addObject("store", listStore); mv.setViewName("goods/allocateorder-edit"); return mv; } /** * 添加调拨单 * @param attr * @param sessionUser * @param goodsSku * @param goodsName * @param goodsCount * @param fromStoreId * @param fromStoreShelfId * @param toStoreId * @param toStoreShelfId * @param fromStoreShelf * @param toStoreShelf * @param order * @return */ @RequestMapping("save") public String save(RedirectAttributes attr, @ModelAttribute(App.SESSION_USER_KEY) SessionUser sessionUser, @RequestParam("goodsSku") List<String> goodsSku, @RequestParam("goodsName") List<String> goodsName, @RequestParam("goodsCount") List<Integer> goodsCount, @RequestParam("fromStoreId") List<Integer> fromStoreId, @RequestParam("fromStoreShelfId") List<Integer> fromStoreShelfId, @RequestParam("toStoreId") List<Integer> toStoreId, @RequestParam("toStoreShelfId") List<Integer> toStoreShelfId, @RequestParam("fromStoreShelf") List<String> fromStoreShelf, @RequestParam("toStoreShelf") List<String> toStoreShelf, GoodsTransferOrder order){ List<GoodsTransferOrderItem> items = new ArrayList<>(3); order.setItems(items); try { for (int i = 0; i < goodsSku.size(); i++) { GoodsTransferOrderItem item = new GoodsTransferOrderItem(); item.setGoodsSku(goodsSku.get(i)); item.setGoodsName(goodsName.get(i)); item.setFromStoreId(fromStoreId.get(i)); item.setFromStoreShelfId(fromStoreShelfId.get(i)); item.setGoodsCount(goodsCount.get(i)); item.setToStoreId(toStoreId.get(i)); item.setToStoreShelfId(toStoreShelfId.get(i)); item.setFromStoreShelf(fromStoreShelf.get(i)); item.setToStoreShelf(toStoreShelf.get(i)); items.add(item); if(item.getFromStoreId().equals(item.getToStoreId())){ if(order.getOrderNo()!=null){ operateLogService.insert("update","调拨单号:"+order.getOrderNo()+"sku:"+item.getGoodsSku()+"---->调出仓库与调入仓库不能相同",sessionUser.getUserId(),"库存管理","调拨单"); } throw new DuplicateDataExcepption("sku:"+item.getGoodsSku()+"---->调出仓库与调入仓库不能相同"); } } if (order.getId() == null) { order.setStatus(1); String dateStr = dft.format(Calendar.getInstance().getTime()); String fmt =String.format("LS-%s-",dateStr)+"%d"; order.setSerialNumber(tableKeyService.nextSerialNumber("goods_transfer_order",fmt)); // 制单人 order.setOperatorId(sessionUser.getUserId()); this.goodsTransferOrderService.save(order); attr.addFlashAttribute("successMessage", "g.tips.success"); operateLogService.insert("insert","调拨单 ->添加: 调拨单号="+order.getOrderNo(),sessionUser.getUserId(),"库存管理","调拨单"); }else { this.goodsTransferOrderService.update(order); attr.addFlashAttribute("successMessage", "g.tips.success"); try{ GoodsTransferOrder gtoOld=goodsTransferOrderService.get(order.getId().longValue()); String editMsg= CommonUtil.getEditMsg(gtoOld,order,order.getClass().getName()); operateLogService.insert("update","调拨单 ->更新: 调拨单号="+order.getOrderNo()+"["+editMsg+"]",sessionUser.getUserId(),"库存管理","调拨单"); }catch(Exception e){ e.printStackTrace(); } } } catch (InventoryShortageException e) { attr.addFlashAttribute("errorMessage", e.getGoodsInventory().getGoodsSku() + "库存不足"); }catch(DuplicateDataExcepption e){ attr.addFlashAttribute("errorMessage", e.getMessage()); } return "redirect:/allocateOrder/list"; } /** * 审核 * @param attr * @param sessionUser * @param id * @return */ @RequestMapping("approve") public String approve(RedirectAttributes attr, @ModelAttribute(App.SESSION_USER_KEY) SessionUser sessionUser, @RequestParam(value="id") Long id) { GoodsTransferOrder gto=goodsTransferOrderService.get(id); synchronized (gto.getOrderNo().intern()){ try { if(gto.getStatus()==1){ this.goodsTransferOrderService.approve(id, sessionUser.getUserId()); } attr.addFlashAttribute("successMessage", "g.tips.success"); operateLogService.insert("update","调拨单 ->审核: 调拨单号="+gto.getOrderNo(),sessionUser.getUserId(),"库存管理","调拨单"); } catch (InventoryShortageException e) { attr.addFlashAttribute("errorMessage", e.getGoodsInventory().getGoodsSku() + "库存不足"); operateLogService.insert("update","调拨单 ->审核: 调拨单号="+gto.getOrderNo()+"----"+e.getGoodsInventory().getGoodsSku() + "库存不足",sessionUser.getUserId(),"库存管理","调拨单"); } return "redirect:/allocateOrder/list"; } } /** * 删除调拨单 * @param attr * @param id * @return */ @RequestMapping("delete") public String delete(RedirectAttributes attr, @ModelAttribute(App.SESSION_USER_KEY) SessionUser sessionUser, @RequestParam(value="id") Long id) { GoodsTransferOrder gto=goodsTransferOrderService.get(id); if(gto.getStatus()==1){ this.goodsTransferOrderService.delete(id); operateLogService.insert("delete","调拨单 ->删除: 调拨单号="+gto.getOrderNo(),sessionUser.getUserId(),"库存管理","调拨单"); attr.addFlashAttribute("successMessage", "g.tips.success"); }else{ attr.addFlashAttribute("errorMessage",gto.getOrderNo()+":末审核调拨单才能删除操作"); } return "redirect:/allocateOrder/list"; } @RequestMapping("pageJson") @ResponseBody public DataTableResponse<GoodsTransferOrder> GoodsTransferOrderPageJson(@RequestBody DataTableRequest<GoodsTransferOrderParam> dtr) { PageRequest pageRequest = WebHelper.assemblePageRequest(dtr); Page<GoodsTransferOrder> page = this.goodsTransferOrderService.findPage(pageRequest,dtr.getParams()); return WebHelper.assembleDataTableResponse(dtr, page); }
相关推荐
本文将围绕“jQuery动态添加table”这一主题进行深入探讨,结合给出的资源,我们可以学习如何利用jQuery高效地在网页上动态创建和操作表格。 首先,我们来看“jQuery动态添加table”的基本概念。在网页设计中,...
首先,我们需要一个基本的HTML结构,包含一个具有特定类和ID的table元素。在这个例子中,我们有一个layui风格的table,id为"datas",包含了thead和tbody部分。thead用于定义表头,tbody则用于存储实际的数据行。表格...
本教程将深入探讨如何使用jQuery实现动态更改table表格数据,让你的网页表格具有实时编辑功能,提升用户体验。 首先,我们需要理解HTML表格的基本结构。一个基本的表格由`<table>`元素开始,包含若干个`<tr>`(行)...
标题 "JQuery 动态生成DIV、Table并处理数据" 涉及的是使用JavaScript库JQuery来动态创建HTML元素,特别是DIV和Table,并且处理其中的数据。这在Web开发中非常常见,尤其是在构建交互式用户界面时。下面将详细阐述这...
在网页开发中,jQuery是一个非常流行的JavaScript库,它极大地简化了DOM操作,包括动态地添加和删除表格行。本文将深入探讨如何使用jQuery实现这一功能,以提高网页交互性。 一、HTML基础 首先,我们需要一个基本...
### jQuery+ajax实现动态添加表格tr td功能 在进行Web开发时,我们经常需要动态地从服务器获取数据,并将这些数据展示在网页上。表格是展示这些数据的一种常见形式。本文将详细解析使用jQuery和ajax技术来实现动态...
在网页开发中,jQuery是一个非常流行的JavaScript库,它极大地简化了DOM操作,包括动态生成HTML元素,如表格(Table)。本实例将详细讲解如何使用jQuery的`append`和`appendto`方法来动态生成Table表格。 首先,让...
对于"jquery实现table的动态排序"这个主题,我们将会深入探讨如何利用jQuery来实现表格数据的动态排序,以便用户可以按照不同列的值进行升序或降序排列,而无需重新加载页面。 首先,我们需要一个包含数据的HTML...
在`jQuery Table`编辑场景中,`jQuery`用于添加交互性,使得用户能够轻松地编辑表格内容。 要实现鼠标点击表格单元格即可编辑的功能,你需要对表格的每个单元格(`td`元素)添加`click`事件监听器。当用户点击单元格...
这篇文章主要介绍了如何使用jQuery在指定的HTML表格(table)中动态地添加和删除行。jQuery是一种广泛使用的JavaScript库,它简化了DOM操作,包括在表格中动态修改内容。 首先,我们要理解HTML表格的基本结构,一个...
本文将详细讲解如何使用jQuery来自定义Table,以及动态构建Table的相关技术。 首先,让我们理解“自定义Table”的概念。在网页开发中,HTML的`<table>`元素通常用于展示结构化数据,但其样式和功能相对有限。通过...
本篇文章将深入探讨如何使用jQuery动态添加控件,包括元素的创建、插入和绑定事件,以及在实际项目中的应用。 首先,我们来了解jQuery如何创建新的HTML元素。在JavaScript中,创建元素通常是通过`document....
此外,还可以利用 jQuery 的动画效果为表格添加视觉上的交互性,比如在插入、删除或更新行时使用淡入淡出效果: ```javascript var $row = $(newRow); $row.hide().appendTo('#myTable tbody').fadeIn(); ``` 总的...
本实例将深入探讨如何利用jQuery实现动态增加和删除表格行的功能,这对于创建数据表或者交互式表单来说非常实用。 首先,我们需要一个基本的HTML结构来展示表格。表格通常由`<table>`元素定义,每一行由`<tr>`元素...
《jQuery UI Table:深入解析与应用实践》 jQuery UI Table是一款基于jQuery库的插件,用于创建功能丰富的表格。在Web开发中,表格是展示数据的常见方式,jQuery UI Table通过提供可定制的样式和交互功能,使得网页...
在网页开发中,表格(Table)是展示数据的常用组件,而jQuery库为开发者提供了丰富的API,使得操作表格中的元素,如复选框(Checkbox),变得更加便捷。本篇将详细探讨如何利用jQuery实现表格中checkbox的相关事件...
jQuery提供了一些方法来添加或删除元素。如果你想在表格中插入一行,可以这样操作: ```javascript var newRow = $('<tr><td>New Data</td><td>More Data</td></tr>'); $('#myTable tbody').append(newRow); `...
jQuery可以方便地选择、添加、删除或修改这些元素。例如,`$('table tr').sort(function(a, b){...})`可以对表格行进行排序。 3. **排序算法**:实现表格排序的关键在于正确的排序算法。常见的有冒泡排序、快速排序...
js与jQuery实现获取table中的数据并拼成json字符串操作示例 本文主要介绍了使用JavaScript和jQuery实现从HTML表格中获取数据并将其拼成JSON字符串的操作示例。该示例涉及到JavaScript和jQuery对HTML页面表格数据的...
在实现假分页中,jQuery主要用来选择元素、添加事件监听器以及执行DOM操作。 2. **HTML结构**:首先,我们需要一个基本的HTML表格结构来显示数据。表格通常由`<table>`、`<thead>`(表头)、`<tbody>`(数据部分)...