| | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.Product; |
| | | import com.whyc.service.*; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.openxml4j.exceptions.InvalidFormatException; |
| | |
| | | |
| | | @ApiOperation(value = "查询出所有的产品信息(分页加模糊查询<产品的编码,型号,名字,定制表编号>)",notes = "8.17修改后使用") |
| | | @GetMapping("getAllProduct") |
| | | public Response getAllProduct(@RequestParam(required = false) String parentCode,@RequestParam(required = false) String parentName, @RequestParam(required = false) String parentModel |
| | | , @RequestParam(required = false) String customCode, @RequestParam int pageCurr, @RequestParam int pageSize){ |
| | | return service.getAllProduct(parentCode,parentName,parentModel,customCode,pageCurr,pageSize); |
| | | public Response getAllProduct(@RequestParam(required = false) String subCode, |
| | | @RequestParam(required = false) String parentCode, |
| | | @RequestParam(required = false) String parentName, |
| | | @RequestParam(required = false) String parentModel, |
| | | @RequestParam(required = false) String customCode, |
| | | @RequestParam int pageCurr, |
| | | @RequestParam int pageSize){ |
| | | return service.getAllProduct(subCode,parentCode,parentName,parentModel,customCode,pageCurr,pageSize); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询出所有的产品无参不分页(产品上传的是用)",notes = "9.2修改后使用") |
| | | @GetMapping("getUpBomUseProduct") |
| | | public Response getUpBomUseProduct(){ |
| | | return service.getUpBomUseProduct(); |
| | | } |
| | | |
| | | @ApiOperation(value = "产品详情查看版本信息",notes = "8.17修改后使用") |
| | | @GetMapping("getProductVersion") |
| | | public Response getProductVersion( @RequestParam String parentCode, String customCode){ |
| | |
| | | public Response getBomHistoryAndMaterial( @RequestParam int productId, @RequestParam int version){ |
| | | return bomHistoryService.getBomHistoryAndMaterial(productId,version); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "历史产品下载(产品id和版本<下载的版本>)",notes = "8.17修改后使用") |
| | | @GetMapping("downloadProductHistory") |
| | | public void downloadProductHistory(HttpServletRequest req, HttpServletResponse resp, @RequestParam int productId, @RequestParam int version){ |
| | |
| | | |
| | | @ApiOperation(value = "历史版本可用性设定",notes = "8.31修改后使用") |
| | | @GetMapping("setpHistoryEnable") |
| | | public Response setpHistoryEnable( @RequestParam String parentCode, @RequestParam String customCode, @RequestParam int version,@RequestParam int enabled) { |
| | | return historyService.setpHistoryEnable(parentCode, customCode, version, enabled); |
| | | public Response setpHistoryEnable( @RequestParam String parentCode, @RequestParam String customCode, @RequestParam int version,@RequestParam int enabled,@RequestParam(required = false) String reason,@RequestParam String versionTime) { |
| | | return historyService.setpHistoryEnable(parentCode, customCode, version, enabled,reason,versionTime); |
| | | } |
| | | @PostMapping("zipParse") |
| | | @ApiOperation("zip解析") |
| | | public Response zipParse(@RequestParam("file") MultipartFile file) throws IOException, InvalidFormatException { |
| | | return service.zipParse(file); |
| | | @ApiOperation(value = "zip解析",notes = "返回结果中,追加data3为对比结果,为key-value集合,key为diffList,addList,deleteList") |
| | | public Response zipParse(@RequestParam("file") MultipartFile file,@RequestParam(required = false) String baseStr) throws IOException, InvalidFormatException { |
| | | //要做对比的产品,传入了物料(parent_code)和定制表单号(custom_code) |
| | | Product baseProduct = (baseStr==null?null:ActionUtil.getGson().fromJson(baseStr, Product.class)); |
| | | return service.zipParse(file,baseProduct); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "新增",notes = "解析时返回的绝对路径,需要回传到字段fileUrl") |
| | | public Response add(@RequestBody Product product){ |
| | | public Response add(@RequestBody Product product) throws IOException { |
| | | return service.add(product); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据产品id查询被锁定的物料dwg和产品丝印",notes = "8.17修改后使用") |
| | | @GetMapping("getLockedByProductId") |
| | | public Response getLockedByProductId( @RequestParam int productId){ |
| | | return service.getLockedByProductId(productId); |
| | | } |
| | | } |