Commit 209a09f7 authored by Yonggang Yuan's avatar Yonggang Yuan

实时库存数据导出UI

parent bf805bbe
......@@ -2,19 +2,25 @@ package com.originspark.drp.controllers.projects.inventories;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.originspark.drp.controllers.BaseController;
import com.originspark.drp.models.User;
import com.originspark.drp.web.models.projects.inventories.CurrentInventoryUI;
@Controller
@RequestMapping("inventories")
public class InventoryController extends BaseController {
private Logger logger = Logger.getLogger(InventoryController.class);
@RequestMapping(value = "/current", method = RequestMethod.GET)
@ResponseBody
......@@ -74,4 +80,15 @@ public class InventoryController extends BaseController {
}
}
}*/
@RequestMapping(value = "/{type}/export", method = RequestMethod.GET)
public void exportExcel(@PathVariable String type, @RequestParam(required=true) String ids,HttpServletRequest request, HttpServletResponse response){
if(type == null || "".equals(type)) {
logger.error("库存导出错误");
return;
}
if("current".equals(type)) {
} else if("monthend".equals(type)) {
}
}
}
package com.originspark.drp.dao;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.springframework.transaction.annotation.Transactional;
@Transactional
......@@ -11,7 +9,7 @@ public abstract class BaseDAOSupport<T> implements BaseDAO<T>{
@PersistenceContext
protected EntityManager em;
public void delete(T entity) {
em.remove(entity);
}
......
......@@ -6,6 +6,7 @@
<%@ include file="/common/meta.jsp"%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>万里磷肥仓储管理系统登录</title>
<link rel="shortcut icon" type="image/x-icon" href="resources/images/ico.png">
<style type="text/css">
<!--
body {
......
......@@ -8,6 +8,7 @@
<head>
<meta charset="UTF-8">
<title>后台管理首页</title>
<link rel="shortcut icon" type="image/x-icon" href="resources/images/ico.png">
<base href="<%=basePath%>">
<%@ include file="/common/meta.jsp"%>
<%@ include file="/common/Ext.jsp"%>
......
......@@ -8,6 +8,12 @@ Ext.define('drp.app.controller.projects.inventories.CurrentInventoryController',
var grid = panel.down('gridpanel');
grid.getStore().load();
}
},
'currentinventoryview button[action=exportCurrentInventoryExcel]' : {
click : function(btn){
var formonth = btn.up('monthendinventoryview').down('monthfield').getSubmitValue();
document.location = "project/"+projectId+"/inventories/current/export?formonth="+formonth;
}
}
});
},
......
......@@ -68,6 +68,17 @@ Ext.define('drp.app.view.projects.inventories.CurrentInventoryView', {
dock : 'bottom',
store : 'drp.app.store.projects.inventories.CurrentInventoryStore',
displayInfo : true
}, {
xtype: 'toolbar',
dock: 'top',
items: ['->', {
xtype: 'button',
icon : 'resources/images/icons/download.gif',
margin : '1 5 1 0',
itemId : 'exportCurrentInventoryExcel_btn',
action : 'exportCurrentInventoryExcel',
text: '导出excel'
}]
}]
}]
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment