123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <%@ page language="java" contentType="text/html; charset=gbk"%>
- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
- <%@page import="java.util.List"%>
- <%@page import="java.util.Map"%>
- <%@page import="java.util.ArrayList"%>
- <%@ page import="com.kpt.common.Util" %>
- <%@page import="java.text.DecimalFormat"%>
- <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
- <meta http-equiv="Content-Type" content="text/html; charset=GBK" />
- <%
- String str = Util.getHeaderType(request,"日计划");
- response.setContentType("application/vnd.ms-excel;charset=gbk");response.setHeader("Content-disposition",str);
- %>
- <head>
- <style>
- .STYLE1 {color: #FFFFFF}
- </style>
- <!--[if gte mso 9]><xml>
- <x:ExcelWorkbook>
- <x:ExcelWorksheets>
- <x:ExcelWorksheet>
- <x:Name>readers</x:Name>
- <x:WorksheetOptions>
- <x:Print>
- <x:ValidPrinterInfo />
- </x:Print>
- </x:WorksheetOptions>
- </x:ExcelWorksheet>
- </x:ExcelWorksheets>
- </x:ExcelWorkbook>
- </xml><![endif]-->
- </head>
- <body style="margin:0";>
- <div class="content">
- <table cellspacing="1" cellpadding="0" border="0" style="width:99%;">
- <tr>
- <td align="center" colspan="${colListSize}">
- <c:if test="${btnType eq 0}">
- <h1><c:out value="${beginDate}" />日计划打印表(按每次投料量)</h1>
- </c:if>
- <c:if test="${btnType eq 1}">
- <h1><c:out value="${beginDate}" />日计划打印表(按投料累加量)</h1>
- </c:if>
- <c:if test="${btnType eq 2}">
- <h1><c:out value="${beginDate}" />日计划打印表(按发料量)</h1>
- </c:if>
- <c:if test="${btnType eq 3}">
- <h1>牧场日粮配合表(<c:out value="${beginDate}" />)</h1>
- </c:if>
- <c:if test="${btnType eq 5}">
- <h1>牧场日粮累加配合表(<c:out value="${beginDate}" />)</h1>
- </c:if>
- <c:if test="${btnType eq 4}">
- <h1><c:out value="${beginDate}" />日计划打印表(包装量)</h1>
- </c:if>
- <c:if test="${btnType eq 6}">
- <h1>牧场日粮实发表(<c:out value="${beginDate}" />(单位:公斤))</h1>
- </c:if>
- </td>
- </tr>
- </table>
- <table cellspacing="1" cellpadding="0" border="1" style="width:99%;" class="tabsty">
- <tbody>
- <tr align="center" style="height: 25px;">
- <c:forEach var="col" items="${colList}">
- <c:if test="${col.name != 'TMR'}">
- <th><c:out value="${col.name}" /></th>
- </c:if>
- <c:if test="${col.name == 'TMR'}">
- <c:if test="${tmrFlag == true}">
- <th><c:out value="${col.name}" /></th>
- </c:if>
- </c:if>
- </c:forEach>
- </tr>
- <%
- Boolean tmrFlag = (Boolean) request.getAttribute("tmrFlag");
- String btnType = (String) request.getAttribute("btnType");
- List colList = (List) request.getAttribute("colList");
- List rsList = (List) request.getAttribute("rsList");
- Float lsVale = 0F;
- DecimalFormat fnum = new DecimalFormat("##0.0");
-
- if("1".equals(btnType)){
- for (int i = 0; i < rsList.size(); i++){
- lsVale = 0F;
- Map rsMap = (Map) rsList.get(i);
- %>
- <tr align="center" class="greb" style="height: 25px;">
- <%
- for (int j = 0; j < colList.size(); j++){
- Map colMap = (Map) colList.get(j);
- String colName = (String)colMap.get("name");
-
- if("没有数据!".equals(colName)){
- %>
- <td>没有数据!</td>
- <%
- }else{
- if("车次".equals(colName)||"时间".equals(colName)||"配方模板".equals(colName)||"日系数比例".equals(colName)||"驾驶员".equals(colName)||"班组".equals(colName)){
- String colValueOld = (String)rsMap.get(colName);
- %>
- <td><c:out value="<%=colValueOld %>"/></td>
- <%
- }else if("TMR".equals(colName)){
- if(tmrFlag){
- String colValueOld = (String)rsMap.get(colName);
- %>
- <td><c:out value="<%=colValueOld %>"/></td>
- <%
- }
- }else{
- String colValueOld = (String)rsMap.get(colName);
- if(!colValueOld.isEmpty()){
- Float colValue = Float.valueOf(colValueOld);
- if(lsVale == 0){
- lsVale = colValue;
- }else{
- lsVale += colValue;
- }
- String colValueNew = fnum.format(lsVale);
- %>
- <td><c:out value="<%=colValueNew %>"/></td>
- <%
- }else{
- %>
- <td><c:out value=""/></td>
- <%
- }
- }
- }
- }
- %>
- </tr>
- <%
- }
- }else{
- for (int i = 0; i < rsList.size(); i++){
- Map rsMap = (Map) rsList.get(i);
- %>
- <tr align="center" class="greb" style="height: 25px;">
- <%
- for (int j = 0; j < colList.size(); j++){
- Map colMap = (Map) colList.get(j);
- String colName = (String)colMap.get("name");
-
- if("没有数据!".equals(colName)){
- %>
- <td>没有数据!</td>
- <%
- }else{
- Object colValueOld = (Object)rsMap.get(colName);
- if(!"TMR".equals(colName)){
- %>
- <td><c:out value="<%=colValueOld %>"/></td>
- <%
- }else{
- if(tmrFlag){
- %>
- <td><c:out value="<%=colValueOld %>"/></td>
- <%
- }
- }
- }
- }
- %>
- </tr>
- <%
- }
- }
- %>
- </tbody>
- </table>
- </div>
- </body>
- </html>
|