package com.web.pda.lyt.lytPda.controller; import com.app.base.control.WebController; import com.app.base.data.ApiResponseResult; import com.web.pda.lyt.lytPda.service.CoatItemService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; @Api(description = "涂布项目") @CrossOrigin @ControllerAdvice //@RestController @Controller @RequestMapping(value = "coat_item") public class CoatItemController extends WebController { @Autowired private CoatItemService coatItemService; @ApiOperation(value = "获取主表数据", notes = "获取主表数据") @RequestMapping(value = "/getMainTable", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getMainTable(@RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "keyword") String keyword, @RequestParam(value = "page") int page, @RequestParam(value = "size") int size) { try { return coatItemService.getMainTable(factory, company, keyword,page,size); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "获取从表数据", notes = "获取从表数据 ") @RequestMapping(value = "/getSubTable", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getSubTable(@RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "mid") String mid) { try { return coatItemService.getSubTable(factory, company,mid); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "修改从表数据", notes = "修改从表数据") @RequestMapping(value = "/updateSubTable", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult updateSubTable( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "did") String did, @RequestParam(value = "stValue") String stValue, @RequestParam(value = "lowValue") String lowValue, @RequestParam(value = "upValue") String upValue, @RequestParam(value = "lowPercent") String lowPercent, @RequestParam(value = "upPercent") String upPercent, @RequestParam(value = "flow") String flow, @RequestParam(value = "fup") String fup, @RequestParam(value = "lowCon") String lowCon, @RequestParam(value = "upCon") String upCon) { try { return coatItemService.updateSubTable(factory, company, did, stValue,lowValue,upValue, lowPercent,upPercent,flow,fup,lowCon,upCon); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } }