package com.whyc.controller;
|
|
import com.whyc.dto.Response;
|
import com.whyc.service.*;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
|
@Api(tags = "产品管理")
|
@RestController
|
@RequestMapping("product")
|
public class ProductController {
|
@Autowired
|
private ProductService service;
|
|
@Autowired
|
private ProductHistoryService historyService;
|
|
@Autowired
|
private ProductBomService bomService;
|
|
@Autowired
|
private ProductBomHistoryService bomHistoryService;
|
|
@Autowired
|
private MaterialService meterService;
|
|
@ApiOperation(value = "建立关联时查询所有的物料(不分页)",notes = "8.17修改后使用")
|
@GetMapping("getAllMaterialNoLimit")
|
public Response getAllMaterialNoLimit(){
|
return meterService.getAllMaterialNoLimit();
|
}
|
|
@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);
|
}
|
@ApiOperation(value = "产品详情查看版本信息",notes = "8.17修改后使用")
|
@GetMapping("getProductVersion")
|
public Response getProductVersion( @RequestParam String parentModel, String customCode){
|
return historyService.getProductVersion(parentModel,customCode);
|
}
|
@ApiOperation(value = "根据产品id和版本查询子件及其关联的物料信息",notes = "8.17修改后使用")
|
@GetMapping("getBomAndMaterial")
|
public Response getBomAndMaterial( @RequestParam int productId, @RequestParam int version){
|
return bomService.getBomAndMaterial(productId,version);
|
}
|
@ApiOperation(value = "产品下载(产品id和版本<当前最新版本>)",notes = "8.17修改后使用")
|
@GetMapping("downloadProduct")
|
public void downloadProduct(HttpServletRequest req, HttpServletResponse resp, @RequestParam int productId, @RequestParam int version){
|
bomService.downloadProduct(req,resp,productId,version);
|
}
|
@ApiOperation(value = "历史产品下载(产品id和版本<下载的版本>)",notes = "8.17修改后使用")
|
@GetMapping("downloadProductHistory")
|
public void downloadProductHistory(HttpServletRequest req, HttpServletResponse resp, @RequestParam int productId, @RequestParam int version){
|
bomHistoryService.downloadProductHistory(req,resp,productId,version);
|
}
|
@ApiOperation(value = "测试",notes = "8.17修改后使用")
|
@GetMapping("getBomHistoryAndMaterial")
|
public Response getBomHistoryAndMaterial( @RequestParam int productId, @RequestParam int version){
|
return bomHistoryService.getBomHistoryAndMaterial(productId,version);
|
}
|
}
|