| | |
| | | List<ProductBom> list=mapper.selectList(wrapper); |
| | | //生成excel并将dwg文件放在同一报下压缩 |
| | | creatBomExcel(req,resp,list,wb); |
| | | //记录日志 |
| | | DocUser docUser= ActionUtil.getUser(); |
| | | String operationDetail="具体产品母料型号为:"+parentModel; |
| | | String opreationMsg="执行了最新版产品下载操作"; |
| | | String terminalIp=req.getRemoteAddr(); |
| | | logService.recordOperationLog(docUser.getId(),docUser.getName(), UserOperation.TYPE_DOWNLOAD.getType(),new Date(),terminalIp,opreationMsg,operationDetail); |
| | | } |
| | | //根据产品信息创建excel表格并存放在指定目录 |
| | | public void creatBomExcel(HttpServletRequest req, HttpServletResponse resp,List<ProductBom> list, HSSFWorkbook wb){ |
| | | public void creatBomExcel(HttpServletRequest req, HttpServletResponse resp,List list, HSSFWorkbook wb){ |
| | | String fileDirName = FileDirPath.getFileDirName(); |
| | | String rootFace=""; |
| | | String pictureName=""; |
| | |
| | | //将选中的文件存入指定目录下打包下载 |
| | | if(list!=null&&list.size()>0){ |
| | | for (int i=0;i<list.size();i++) { |
| | | ProductBom bom=list.get(i); |
| | | ProductBom bom= (ProductBom) list.get(i); |
| | | String dwgUrl=bom.getDwgUrl(); |
| | | if(i==0){ |
| | | excelName=bom.getParentCode(); |
| | |
| | | in.close(); |
| | | out.close(); |
| | | file.delete(); |
| | | //ZipUtils.delDir(rootFace); |
| | | ZipUtils.delDir(rootFace); |
| | | } catch (FileNotFoundException | UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | //查询所有产品中没有与指定散装件关联的子件 |
| | | public Response getAllSubWithOutComponent(int componentId) { |
| | | List<ProductBom> list=mapper.getAllSubWithOutComponent(componentId); |
| | | return new Response().setII(1,list.size()>0?true:false,list,"返回数据"); |
| | | } |
| | | //根据母料型号查询子件信息及有最新版本关联的散装件信息 |
| | | public Response getSubByComponentProduct(String parentModel) { |
| | | List<ProductBom> list=mapper.getSubByComponentProduct(parentModel); |
| | | return new Response().setII(1,list.size()>0?true:false,list,"返回数据"); |
| | | } |
| | | } |