package com.web.spcBasic.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.app.base.control.WebController; import com.app.base.data.ApiResponseResult; import com.web.spcBasic.service.ChartSpcService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; /** * spc六合一图和柏拉图 * @author fyx *2023-03-18 */ @Api(description = "spc六合一图和柏拉图") @RestController @RequestMapping(value = "/spc/chart") public class ChartSpcController extends WebController { @Autowired private ChartSpcService chartSpcService; @ApiOperation(value="获取产品信息", notes="获取产品信息") @RequestMapping(value = "/getProductList", method = RequestMethod.GET) public ApiResponseResult getProductList(String keyword) { try { Sort sort = new Sort(Sort.Direction.DESC,"id"); return chartSpcService.getProductList(keyword,super.getPageRequest(sort)); } catch (Exception e) { return ApiResponseResult.failure("获取产品信息失败!"+e.getMessage()); } } @ApiOperation(value="获取料号信息", notes="获取料号信息") @RequestMapping(value = "/getItemnoList", method = RequestMethod.GET) public ApiResponseResult getItemnoList(String productCode,String keyword) { try { return chartSpcService.getItemnoList(productCode, keyword); } catch (Exception e) { return ApiResponseResult.failure("获取料号信息!"+e.getMessage()); } } @ApiOperation(value="根据产品编码获取工序信息", notes="根据产品编码获取工序信息") @RequestMapping(value = "/getProcessList", method = RequestMethod.GET) public ApiResponseResult getProcessList(String productCode,String keyword) { try { return chartSpcService.getProcessList(productCode,keyword); } catch (Exception e) { return ApiResponseResult.failure("根据产品编码获取工序信息失败!"+e.getMessage()); } } @ApiOperation(value="根据产品编码工序获取特性信息", notes="根据产品编码工序获取特性信息") @RequestMapping(value = "/getItemList", method = RequestMethod.GET) public ApiResponseResult getItemList(String productCode,String porcessCode,String keyword) { try { return chartSpcService.getItemList(productCode,porcessCode,keyword); } catch (Exception e) { return ApiResponseResult.failure("根据产品编码工序获取特性信息失败!"+e.getMessage()); } } @ApiOperation(value="获取初始化六合一图", notes="获取初始化六合一图") @RequestMapping(value = "/getFirstInOneChart", method = RequestMethod.GET) public ApiResponseResult getFirstInOneChart(String process,String project, String item_id,String fdate,String tdate) { try { return chartSpcService.getFirstInOneChart(process, project, item_id, fdate, tdate); } catch (Exception e) { return ApiResponseResult.failure(e.getMessage()); } } @ApiOperation(value="查询六合一图", notes="查询六合一图") @RequestMapping(value = "/getInOneChart", method = RequestMethod.GET) public ApiResponseResult getInOneChart(String process,String project, String item_id,String fdate,String tdate) { try { return chartSpcService.getInOneChart(process, project, item_id, fdate, tdate); } catch (Exception e) { return ApiResponseResult.failure(e.getMessage()); } } @ApiOperation(value="查询SPC图形的原始数据", notes="查询SPC图形的原始数据") @RequestMapping(value = "/getSpcData", method = RequestMethod.GET) public ApiResponseResult getSpcData(String keyword, String suppCode,String prCode, String feId,String fdate,String tdate) { try { Sort sort = new Sort(Sort.Direction.ASC,"bsInputTime"); return chartSpcService.getSpcData(keyword,suppCode, prCode, feId, fdate, tdate,super.getPageRequest(sort)); } catch (Exception e) { return ApiResponseResult.failure(e.getMessage()); } } @ApiOperation(value="查询六合一图", notes="查询六合一图") @RequestMapping(value = "/getInOneChartAndItemnos", method = RequestMethod.GET) public ApiResponseResult getInOneChartAndItemnos(String process, String project, String item_nos, String item_id, String fdate, String tdate) { try { return chartSpcService.getInOneChartAndItemnos(process, project, item_nos, item_id, fdate, tdate); } catch (Exception e) { return ApiResponseResult.failure(e.getMessage()); } } }