瀏覽代碼

非订单框体手动版调试问题修改
订单导入模板文件动态生成及下载

yejian 3 年之前
父節點
當前提交
938ab18ae2

+ 2 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/OrderService.java

@@ -9,6 +9,7 @@ import com.github.zuihou.business.operationManagementCenter.entity.Order;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.security.model.SysUser;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 import java.util.Map;
 
@@ -88,4 +89,5 @@ public interface OrderService extends SuperService<Order> {
      */
     Boolean deleteOrder(Order model);
 
+    void downloadOrderTemplate(HttpServletResponse httpServletResponse);
 }

+ 208 - 13
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/OrderServiceImpl.java

@@ -2,7 +2,7 @@ package com.github.zuihou.business.operationManagementCenter.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollectionUtil;
-import com.alibaba.druid.sql.dialect.postgresql.ast.stmt.PGAlterTableAlterColumnSetNotNull;
+import cn.hutool.core.convert.Convert;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -10,16 +10,15 @@ import com.github.zuihou.authority.dao.auth.StationUserLoginInfoMapper;
 import com.github.zuihou.authority.dao.auth.UserMapper;
 import com.github.zuihou.authority.entity.auth.StationUserLoginInfo;
 import com.github.zuihou.authority.entity.auth.User;
-import com.github.zuihou.authority.entity.common.DictionaryItem;
 import com.github.zuihou.authority.service.common.ParameterService;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.service.SuperServiceImpl;
 import com.github.zuihou.business.DemoLine.DemoCacheKey;
 import com.github.zuihou.business.DemoLine.DemoLineConstant;
 import com.github.zuihou.business.aps.algorithm.ga.GAScheduler;
-import com.github.zuihou.business.aps.instance.domain.basicdata.*;
-import com.github.zuihou.business.classSchedule.entity.ScheduleUser;
-import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
+import com.github.zuihou.business.aps.instance.domain.basicdata.CandidateProcess;
+import com.github.zuihou.business.aps.instance.domain.basicdata.Instance;
+import com.github.zuihou.business.aps.instance.domain.basicdata.Machine;
 import com.github.zuihou.business.operationManagementCenter.dao.*;
 import com.github.zuihou.business.operationManagementCenter.dto.OrderProductUpdateDTO;
 import com.github.zuihou.business.operationManagementCenter.dto.OrderUpdateDTO;
@@ -29,21 +28,24 @@ import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
 import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureProductionresourceMapper;
 import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureProgramMapper;
 import com.github.zuihou.business.productionReadyCenter.dao.MMeterialReceiveLogMapper;
-import com.github.zuihou.business.productionReadyCenter.entity.*;
+import com.github.zuihou.business.productionReadyCenter.entity.BBom;
+import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
+import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureProductionresource;
+import com.github.zuihou.business.productionReadyCenter.entity.MMeterialReceiveLog;
 import com.github.zuihou.business.productionReadyCenter.service.AutoNodeService;
-import com.github.zuihou.business.productionReadyCenter.service.BBomService;
 import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
 import com.github.zuihou.business.productionReadyCenter.service.MMeterialReceiveLogService;
 import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
 import com.github.zuihou.business.productionResourceCenter.dao.ZZoneMapper;
 import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
-import com.github.zuihou.business.productionResourceCenter.entity.Repair;
 import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
 import com.github.zuihou.business.productionResourceCenter.service.RepairService;
 import com.github.zuihou.business.util.DynamicRabbitMq;
-import com.github.zuihou.common.constant.*;
+import com.github.zuihou.common.constant.BizConstant;
+import com.github.zuihou.common.constant.CodeRuleModule;
+import com.github.zuihou.common.constant.ParameterKey;
+import com.github.zuihou.common.constant.RepeatCacheKey;
 import com.github.zuihou.common.util.DateUtil;
-import com.github.zuihou.common.util.StringUtil;
 import com.github.zuihou.database.mybatis.auth.DataScope;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
@@ -53,14 +55,23 @@ import com.github.zuihou.tenant.service.CodeRuleService;
 import com.github.zuihou.utils.BeanPlusUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.ss.usermodel.BorderStyle;
+import org.apache.poi.ss.usermodel.FillPatternType;
+import org.apache.poi.ss.usermodel.IndexedColors;
+import org.apache.poi.ss.util.CellRangeAddress;
+import org.apache.poi.ss.util.CellRangeAddressList;
+import org.apache.poi.xssf.usermodel.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.math.BigDecimal;
-import java.sql.Timestamp;
-import java.time.LocalDateTime;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
@@ -142,6 +153,8 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
     private UserMapper userMapper;
     @Autowired
     private ProductionresourceBizMapper productionresourceBizMapper;
+    @Autowired
+    private MMeterialReceiveLogMapper mMeterialReceiveLogMapper;
 
     @Override
     public IPage<Order> pageList(IPage page,String sustDesc, LbqWrapper<Order> wrapper) {
@@ -1015,4 +1028,186 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
         s = s.substring(0,list.size());
         return s;
     }
+
+   @Override
+   public void downloadOrderTemplate(HttpServletResponse httpServletResponse){
+       String name = "orderTemplate.xlsx";
+       FileOutputStream fileOut = null;
+       OutputStream outputStream = null;
+       File temp = null;
+       try {
+           temp = File.createTempFile("orderTemplate", ".xlsx");
+           // 文件初始化
+           XSSFWorkbook wb = new XSSFWorkbook ();
+           XSSFCellStyle style = wb.createCellStyle();
+           style.setBorderRight(BorderStyle.THIN);
+           style.setBorderTop(BorderStyle.THIN);
+           style.setBorderLeft(BorderStyle.THIN);
+           style.setBorderBottom(BorderStyle.THIN);
+
+           XSSFCellStyle style1 = wb.createCellStyle();
+           style1.setBorderRight(BorderStyle.THIN);
+           style1.setBorderTop(BorderStyle.THIN);
+           style1.setBorderLeft(BorderStyle.THIN);
+           style1.setBorderBottom(BorderStyle.THIN);
+           style1.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex()); //设置背景色
+           style1.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+
+
+           XSSFSheet sheet = wb.createSheet("orderTemplate");
+           for (int i = 0; i <= 5; i++)
+           {
+               sheet.autoSizeColumn((short)i,true); //调整列宽
+           }
+           // 在第一行插入需要填写的订单信息
+           XSSFRow row1 = sheet.createRow(0);
+
+           XSSFCell row1cell1 = row1.createCell(0);
+           XSSFCell row1cell2 = row1.createCell(1);
+           XSSFCell  row1cell3 = row1.createCell(2);
+           XSSFCell row1cell4 = row1.createCell(3);
+           XSSFCell  row1cell5 = row1.createCell(4);
+           XSSFCell  row1cell6 = row1.createCell(5);
+           row1cell1.setCellValue("订单名称:");
+           row1cell3.setCellValue("下单时间:");
+           row1cell5.setCellValue("所属产线:");
+           row1cell6.setCellValue("请选择");
+           row1cell1.setCellStyle(style);
+           row1cell2.setCellStyle(style);
+           row1cell3.setCellStyle(style);
+           row1cell4.setCellStyle(style);
+           row1cell5.setCellStyle(style);
+           row1cell6.setCellStyle(style);
+           // 生成下拉框内容
+           QueryWrapper<ZZone> zZoneWrapper = new QueryWrapper<ZZone>();
+           zZoneWrapper.eq("status",1);
+           List<ZZone> zZones = zZoneMapper.selectList(zZoneWrapper);
+           List<String> zZoneList = new ArrayList<>();
+           for(ZZone zZone: zZones){
+               zZoneList.add(zZone.getId() + "-"+ zZone.getName());
+           }
+           String[] zZoneInfos = new String[zZoneList.size()];
+           zZoneList.toArray(zZoneInfos);
+
+           XSSFDataValidationHelper dvHelper = new XSSFDataValidationHelper((XSSFSheet)sheet);
+           XSSFDataValidationConstraint zZoneConstraint = (XSSFDataValidationConstraint) dvHelper
+                   .createExplicitListConstraint(zZoneInfos);
+           CellRangeAddressList zZoneRange = new CellRangeAddressList(0, 0, 5, 5);
+           XSSFDataValidation zZoneValidation = (XSSFDataValidation) dvHelper.createValidation(zZoneConstraint, zZoneRange);
+           zZoneValidation.setSuppressDropDownArrow(true);
+           zZoneValidation.setShowErrorBox(true);
+           sheet.addValidationData(zZoneValidation);
+
+           // 设置第二行表头
+           XSSFRow row2 = sheet.createRow(1);
+           XSSFCell row2cell1 = row2.createCell(0);
+           XSSFCell row2cell2 = row2.createCell(1);
+           XSSFCell row2cell3 = row2.createCell(2);
+           XSSFCell row2cell4 = row2.createCell(3);
+           XSSFCell row2cell5 = row2.createCell(4);
+           row2cell1.setCellValue("零件名称");
+           row2cell2.setCellValue("原炉批号");
+           row2cell3.setCellValue("数量");
+           row2cell4.setCellValue("交货日期");
+           row2cell5.setCellValue("备注");
+           row2cell1.setCellStyle(style1);
+           row2cell2.setCellStyle(style1);
+           row2cell3.setCellStyle(style1);
+           row2cell4.setCellStyle(style1);
+           row2cell5.setCellStyle(style1);
+           // 起始行, 终止行, 起始列, 终止列
+           CellRangeAddress cra =new CellRangeAddress(1, 1, 4, 5);
+           sheet.addMergedRegion(cra);
+
+           // 设置第三行选中零件
+           XSSFRow row3 = sheet.createRow(2);
+           XSSFCell row3cell1 = row3.createCell(0);
+           XSSFCell row3cell2 = row3.createCell(1);
+           XSSFCell row3cell3 = row3.createCell(2);
+           XSSFCell row3cell4 = row3.createCell(3);
+           XSSFCell row3cell5 = row3.createCell(4);
+           XSSFCell row3cell6 = row3.createCell(5);
+           row3cell1.setCellValue("请选择");
+           row3cell2.setCellValue("请选择");
+           row3cell1.setCellStyle(style);
+           row3cell2.setCellStyle(style);
+           row3cell3.setCellStyle(style);
+           row3cell4.setCellStyle(style);
+           row3cell5.setCellStyle(style);
+           row3cell6.setCellStyle(style);
+           CellRangeAddress cra1 =new CellRangeAddress(2, 2, 4, 5);
+           sheet.addMergedRegion(cra1);
+
+           QueryWrapper<BBom> bBomWrapper = new QueryWrapper<BBom>();
+           bBomWrapper.eq("audit_status",2);
+           bBomWrapper.eq("status",1);
+           List<BBom> bBoms = bBomMapper.selectList(bBomWrapper);
+           List<String> bBomList = new ArrayList<>();
+           for(BBom bBom: bBoms){
+               bBomList.add(bBom.getId() + "-"+ bBom.getName());
+           }
+           String[] bBomInfos = new String[bBomList.size()];
+           bBomList.toArray(bBomInfos);
+
+           // 设置第三行选中零件
+           List<Map<String,String>> mMeterials = mMeterialReceiveLogMapper.selectValidMeterialList();
+           List<String> mMeterialsList = new ArrayList<>();
+           for(Map data: mMeterials){
+               mMeterialsList.add(data.get("name") + "-"+ data.get("equipmentName") + "-" + data.get("furnaceBatchNo") + "-" + data.get("remindNum") );
+           }
+           String[] mMeterialses = new String[mMeterialsList.size()];
+           mMeterialsList.toArray(mMeterialses);
+
+           XSSFDataValidationConstraint bomConstraint = (XSSFDataValidationConstraint) dvHelper
+                   .createExplicitListConstraint(bBomInfos);
+           CellRangeAddressList bomRange = new CellRangeAddressList(2, 10, 0, 0);
+           XSSFDataValidation bomValidation = (XSSFDataValidation) dvHelper.createValidation(bomConstraint, bomRange);
+           bomValidation.setSuppressDropDownArrow(true);
+           bomValidation.setShowErrorBox(true);
+           sheet.addValidationData(bomValidation);
+
+           XSSFDataValidationConstraint mMeterialsesConstraint = (XSSFDataValidationConstraint) dvHelper
+                   .createExplicitListConstraint(mMeterialses);
+           CellRangeAddressList mMeterialsesRange = new CellRangeAddressList(2, 10, 1, 1);
+           XSSFDataValidation mMeterialsesRangeValidation = (XSSFDataValidation) dvHelper.createValidation(mMeterialsesConstraint, mMeterialsesRange);
+           mMeterialsesRangeValidation.setSuppressDropDownArrow(true);
+           mMeterialsesRangeValidation.setShowErrorBox(true);
+           sheet.addValidationData(mMeterialsesRangeValidation);
+
+
+           // 写入文件
+           fileOut = new FileOutputStream(temp.getAbsolutePath());
+           wb.write(fileOut);
+           fileOut.flush();
+           outputStream = httpServletResponse.getOutputStream();
+           httpServletResponse.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+           httpServletResponse.setHeader("Content-Disposition", "attachment; filename=\"" + name + "\"");
+           httpServletResponse.addHeader("Cache-Control", "no-cache, no-store, must-revalidate");
+           httpServletResponse.addHeader("charset", "utf-8");
+           httpServletResponse.addHeader("Pragma", "no-cache");
+           wb.write(outputStream);
+       } catch (Exception e) {
+           e.printStackTrace();
+       } finally {
+           if(null != fileOut){
+               try {
+                   fileOut.close();
+               } catch (IOException e) {
+                   e.printStackTrace();
+               }
+           }
+           if (null != outputStream) {
+               try {
+                   outputStream.flush();
+                   outputStream.close();
+               } catch (IOException e) {
+                   e.printStackTrace();
+               }
+           }
+           // 删除零时文件
+           if (null != outputStream ) {
+//               temp.delete();
+           }
+       }
+   }
 }

+ 5 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/dao/MMeterialReceiveLogMapper.java

@@ -9,6 +9,9 @@ import com.github.zuihou.business.productionReadyCenter.entity.Plate;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * <p>
  * Mapper 接口
@@ -21,4 +24,6 @@ import org.springframework.stereotype.Repository;
 @Repository
 public interface MMeterialReceiveLogMapper extends SuperMapper<MMeterialReceiveLog> {
     IPage<MMeterialReceiveLog> pageList(IPage page, @Param(Constants.WRAPPER) Wrapper<MMeterialReceiveLog> queryWrapper);
+
+    List<Map<String, String>> selectValidMeterialList();
 }

+ 9 - 8
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/util/ManualTaskOperatorUtil.java

@@ -239,14 +239,11 @@ public class ManualTaskOperatorUtil {
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("move".equals(taskType) && currentIndex == 3){
                         String hostSyetemTaskUrl = hostSyetemUrl + "/api/MoveRobotPosition";
-                        // 查找设备机器人
-                        productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId() && "1".equals(p.getLockStatus())).collect(toList());
-
                         String location = manualInfo.getEndpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }if("get".equals(taskType) && currentIndex == 4){
                         String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetFlexibleWire";
-                        productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId()).collect(toList());
+                        productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId()  && "1".equals(p.getLockStatus())).collect(toList());
 
                         String location = productionresourcePositions.get(0).getPointId().toString();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
@@ -281,19 +278,23 @@ public class ManualTaskOperatorUtil {
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("put".equals(taskType) && currentIndex == 2){
                         String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendFlexibleWire";
-                        String location = manualInfo.getStartpointId();
+                        productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId() && "1".equals(p.getLockStatus())).collect(toList());
+
+                        String location = productionresourcePositions.get(0).getPointId().toString();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("move".equals(taskType) && currentIndex == 3){
                         String hostSyetemTaskUrl = hostSyetemUrl + "/api/MoveRobotPosition";
-                        String location = manualInfo.getStartpointId();
+                        String location = manualInfo.getEndpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }if("get".equals(taskType) && currentIndex == 4){
                         String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetFlexibleWire";
-                        String location = manualInfo.getStartpointId();
+                        productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId()  && "1".equals(p.getLockStatus())).collect(toList());
+
+                        String location = productionresourcePositions.get(0).getPointId().toString();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }else if("put".equals(taskType) && currentIndex == 5){
                         String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendFlexibleWire";
-                        String location = manualInfo.getStartpointId();
+                        String location = manualInfo.getEndpointId();
                         setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
                     }
                     manualInfo.setNextTaskNodeIndex(nextTaskNodeIndex);

+ 13 - 0
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionReadyCenter/MMeterialReceiveLogMapper.xml

@@ -35,4 +35,17 @@
         left join imcs_m_meterial m on l.meterial_id = m.id
         ) s ${ew.customSqlSegment}
     </select>
+    <select id="selectValidMeterialList" resultType="java.util.Map">
+        SELECT
+          izz.name,
+          imm.equipment_name AS equipmentName,
+          immrl.furnace_batch_no  AS furnaceBatchNo,
+          immrl.batch_stand - immrl.used_num AS remindNum
+        FROM imcs_z_zone izz,
+             imcs_m_meterial imm,
+             imcs_m_meterial_receive_log immrl
+        WHERE izz.id = imm.zone_id
+        AND imm.id = immrl.meterial_id
+        AND immrl.batch_stand - immrl.used_num > 0
+    </select>
 </mapper>

+ 21 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/OrderController.java

@@ -1,5 +1,7 @@
 package com.github.zuihou.business.controller.operationManagementCenter;
 
+import cn.afterturn.easypoi.excel.ExcelExportUtil;
+import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -12,8 +14,13 @@ import com.github.zuihou.business.operationManagementCenter.entity.OrderProduct;
 import com.github.zuihou.business.operationManagementCenter.service.OrderProductService;
 import com.github.zuihou.business.operationManagementCenter.service.OrderService;
 
+import java.io.*;
+import java.net.URL;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -29,6 +36,9 @@ import com.github.zuihou.security.model.SysUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.poi.hssf.usermodel.*;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.apache.poi.ss.util.CellRangeAddressList;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -38,6 +48,9 @@ import com.github.zuihou.security.annotation.PreAuth;
 import org.springframework.web.bind.annotation.RestController;
 import springfox.documentation.annotations.ApiIgnore;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
 
 /**
  * <p>
@@ -194,4 +207,12 @@ public class OrderController extends SuperController<OrderService, Long, Order,
     }
 
 
+    @ApiOperation(value = "下载订单导入模板", notes = "下载订单导入模板")
+    @PostMapping("/downloadOrderTemplate")
+    public void downloadOrderTemplate(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, @RequestBody Map<String,Object> params) throws IOException {
+
+        baseService.downloadOrderTemplate(httpServletResponse);
+
+    }
+
 }

+ 0 - 4
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/PlanController.java

@@ -239,7 +239,6 @@ public class PlanController extends SuperController<PlanService, Long, Plan, Pla
         FileOutputStream fos = new FileOutputStream(temp.getAbsolutePath());
 
 
-        BufferedInputStream bis = null;
         OutputStream outputStream = null;
         try {
             // 模板填充数据
@@ -255,9 +254,6 @@ public class PlanController extends SuperController<PlanService, Long, Plan, Pla
         } catch ( IOException e ) {
             e.printStackTrace();
         } finally {
-            if (bis != null) {
-                bis.close();
-            }
             if (outputStream != null) {
                 outputStream.flush();
                 outputStream.close();