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.PQCSampleSignService; 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 = "sample_sign") public class PQCSampleSignController extends WebController { @Autowired private PQCSampleSignService pqcSampleSignService; @ApiOperation(value = "获取数据源", notes = "获取数据源") @RequestMapping(value = "/getDataSource", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getDataSource(@RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "ftype") String ftype, @RequestParam(value = "keyword") String keyword, @RequestParam(value = "boardModel") String boardModel) { try { return pqcSampleSignService.getDataSource(factory, company, ftype,keyword,boardModel); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "保存数据", notes = "保存数据") @RequestMapping(value = "/saveData", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult saveData( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "boardModel") String boardModel, @RequestParam(value = "taskNo") String taskNo, @RequestParam(value = "expireDate") String expireDate, @RequestParam(value = "procName") String procName, @RequestParam(value = "procNo") String procNo, @RequestParam(value = "badItem") String badItem, @RequestParam(value = "signer") String signer) { try { return pqcSampleSignService.saveData(factory, company, userNo, boardModel,taskNo,expireDate, procName,procNo,badItem,signer); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "提交数据", notes = "提交数据 ") @RequestMapping(value = "/sumbitData", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult sumbitData(@RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "mid") String mid, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "operaType") String operaType, @RequestParam(value = "remark") String remark, @RequestParam(value = "tableName") String tableName) { try { return pqcSampleSignService.sumbitData(factory, company,mid,userNo,operaType,remark,tableName); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "获取样品录入操作记录", notes = "获取样品录入操作记录 ") @RequestMapping(value = "/getRecordList", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getRecordList(@RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "keyword") String keyword, @RequestParam(value = "size") int size, @RequestParam(value = "page") int page) { try { return pqcSampleSignService.getRecordList(factory, company,keyword,size,page); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } }