| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.constant.UserOperation; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.DocUser; |
| | | import com.whyc.pojo.ProductBom; |
| | | import com.whyc.service.DocLogService; |
| | | import com.whyc.service.ProductBomService; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "图纸管理") |
| | | @RestController |
| | |
| | | @Autowired |
| | | private ProductBomService service; |
| | | |
| | | @Autowired |
| | | private DocLogService logService; |
| | | |
| | | @ApiOperation("图纸查询分类检索") |
| | | @PostMapping("searchCadDrawer") |
| | | public Response searchCadDrawer(@RequestBody ProductBom productBom, @RequestParam int pageCurr, @RequestParam int pageSize){ |
| | | return service.searchCadDrawer(productBom,pageCurr,pageSize); |
| | | } |
| | | |
| | | /* |
| | | @ApiOperation("图纸文件打包下载") |
| | | @GetMapping("downloadCadDrawer") |
| | | public void downloadCadDrawer(HttpServletRequest req, HttpServletResponse resp, String[] pictureUrls){ |
| | | service.downloadCadDrawer(req,resp,pictureUrls); |
| | | } |
| | | @PostMapping("downloadCadDrawer") |
| | | public void downloadCadDrawer(HttpServletRequest req, HttpServletResponse resp,@RequestBody List<ProductBom> boms){ |
| | | service.downloadCadDrawer(req,resp,boms); |
| | | }*/ |
| | | @ApiOperation(value = "根据子件code获取最终的信息") |
| | | @GetMapping("getBomBySubcode") |
| | | public Response getBomBySubcode(@RequestParam String scode){ |
| | | return service.getBomBySubcode(scode); |
| | | } |
| | | |
| | | @ApiOperation(value = "下载操作日志记录") |
| | | @GetMapping("downloadLog") |
| | | public Response downloadLog(@RequestParam(required = false) String parentModel,@RequestParam(required = false) String subModel){ |
| | | public Response downloadLog(HttpServletRequest req,@RequestParam(required = false) String parentModel,@RequestParam(required = false) String subModel){ |
| | | DocUser docUser= ActionUtil.getUser(); |
| | | String operationDetail="具体文件型号为:"+parentModel+"母料型号下的"+subModel+"子料型号"; |
| | | String opreationMsg="执行了文件下载操作"; |
| | | String terminalIp=req.getRemoteAddr(); |
| | | logService.recordOperationLog(docUser.getId(),docUser.getName(), UserOperation.TYPE_DOWNLOAD.getType(),new Date(),terminalIp,opreationMsg,operationDetail); |
| | | return new Response().set(1,true,"记录下载日志"); |
| | | } |
| | | |
| | | /* @ApiOperation(tags = "产品管理",value = "获取所有产品信息") |
| | | @GetMapping("getAllBom") |
| | | public Response getAllBom( @RequestParam(required = false) String parentCode,@RequestParam(required = false) String parentName, @RequestParam(required = false) String parentModel, @RequestParam int pageCurr, @RequestParam int pageSize){ |
| | | return service.getAllBom(parentCode,parentName,parentModel,pageCurr,pageSize); |
| | | }*/ |
| | | |
| | | /*@ApiOperation(tags = "产品管理",value = "根据母料型号查询子件信息及有最新版本关联的散装件信息") |
| | | @GetMapping("getSubByMaterialProduct") |
| | | public Response getSubByMaterialProduct(@RequestParam String parentModel){ |
| | | return service.getSubByMaterialProduct(parentModel); |
| | | }*/ |
| | | |
| | | /*@ApiOperation(tags = "产品管理",value = "产品打包下载") |
| | | @GetMapping("downloadBom") |
| | | public void downloadBom(HttpServletRequest req, HttpServletResponse resp,@RequestParam String parentModel){ |
| | | service.downloadBom(req,resp,parentModel); |
| | | }*/ |
| | | @ApiOperation(tags = "散装件管理",value = "查询所有产品中没有与指定散装件关联的子件") |
| | | @GetMapping("getAllSubWithOutMaterial") |
| | | public Response getAllSubWithOutMaterial(@RequestParam int MaterialId){ |
| | | return service.getAllSubWithOutMaterial(MaterialId); |
| | | } |
| | | |
| | | } |