| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | return new Response().setII(1,list!=null,pageInfo,"返回数据"); |
| | | }*/ |
| | | //产品下载(产品id和版本) |
| | | public void downloadProduct(HttpServletRequest req, HttpServletResponse resp, int productId , int version) { |
| | | public void downloadProduct(HttpServletRequest req, HttpServletResponse resp, int productId , int version |
| | | , @RequestParam String oprateReason, @RequestParam String oprateInfo) { |
| | | HSSFWorkbook wb = new HSSFWorkbook(); |
| | | //读取产品信息 |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | |
| | | withOutDwg+=File.separator+"standard"+File.separator+version; |
| | | } |
| | | //生成excel并将dwg文件放在同一报下压缩 |
| | | creatBomExcel(req,resp,product,endList,wb,withOutDwg); |
| | | creatBomExcel(req,resp,product,endList,wb,withOutDwg,ActionUtil.sdfwithALL.format(product.getVersionTime()),oprateReason,oprateInfo); |
| | | } |
| | | |
| | | |
| | | //根据产品信息创建excel表格并存放在指定目录 |
| | | private void creatBomExcel(HttpServletRequest req, HttpServletResponse resp,Product product,List list, HSSFWorkbook wb,String withOutDwg){ |
| | | private void creatBomExcel(HttpServletRequest req, HttpServletResponse resp,Product product,List list, HSSFWorkbook wb,String withOutDwg |
| | | , String oprateVersion, @RequestParam String oprateReason, @RequestParam String oprateInfo){ |
| | | String fileDirName = FileDirPath.getFileDirName(); |
| | | String rootFace=""; |
| | | String excelName=""; |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | //记录日志 |
| | | logService.recordOperationLog(ActionUtil.getUser().getId(),ActionUtil.getUser().getName(), UserOperation.TYPE_DOWNLOAD_New.getType(),new Date(),req.getRemoteAddr(),excelName,rootFace+".zip"); |
| | | logService.recordOperationLogDownLoad(ActionUtil.getUser().getId(),ActionUtil.getUser().getName(), UserOperation.TYPE_DOWNLOAD_PRODUCT.getType(),new Date(),req.getRemoteAddr() |
| | | ,excelName+".zip",rootFace+".zip",oprateReason,oprateInfo,oprateVersion); |
| | | } |
| | | //查询所有产品中没有与指定散装件关联的子件 |
| | | public Response getAllSubWithOutMaterial(int materialId) { |