| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletRequest; |
| | |
| | | return new Response().setIIII(1,list.size()>0,list,listsoft,fIleSilkLock,"返回物料信息及关联物料"); |
| | | } |
| | | //历史产品下载(产品id和版本<下载的版本>) |
| | | public void downloadProductHistory(HttpServletRequest req, HttpServletResponse resp, int productId, int version) { |
| | | public void downloadProductHistory(HttpServletRequest req, HttpServletResponse resp, int productId, int version |
| | | , String oprateReason, String oprateInfo) { |
| | | //读取产品信息 |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("id",productId); |
| | |
| | | withOutDwg+=File.separator+"standard"+File.separator+version; |
| | | } |
| | | //生成excel并将dwg文件放在同一报下压缩 |
| | | creatBomHsitoryExcel(req,resp,pHistory,endList,withOutDwg); |
| | | creatBomHsitoryExcel(req,resp,pHistory,endList,withOutDwg,oprateReason,oprateInfo,version); |
| | | } |
| | | //根据产品信息创建excel表格并存放在指定目录 |
| | | public void creatBomHsitoryExcel(HttpServletRequest req, HttpServletResponse resp,ProductHistory pHistory,List<ProductBomHistory> list,String withOutDwg){ |
| | | public void creatBomHsitoryExcel(HttpServletRequest req, HttpServletResponse resp,ProductHistory pHistory,List<ProductBomHistory> list,String withOutDwg |
| | | , String oprateReason, String oprateInfo,int version){ |
| | | 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+".zip",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,String.valueOf(version)); |
| | | } |
| | | |
| | | //将物料存放为一个bomHistory为下载做准备 |