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.PQCInputService; 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 = "PQC首检录入") @CrossOrigin @ControllerAdvice //@RestController @Controller @RequestMapping(value = "pqc_first_input") public class PQCInputController extends WebController { @Autowired private PQCInputService pqcInputService; @ApiOperation(value = "获取批号下拉数据源", notes = "获取批号下拉数据源") @RequestMapping(value = "/getBatchNum", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getBatchNum( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "ftype") String ftype, @RequestParam(value = "procno") String procno, @RequestParam(value = "modelno") String modelno, @RequestParam(value = "keyword") String keyword) { try { return pqcInputService.getBatchNum(factory, company,ftype,procno,modelno,keyword); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "获取批号详细信息", notes = "获取批号详细信息") @RequestMapping(value = "/getBatchNumInfo", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getBatchNumInfo( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "lineType") String lineType, @RequestParam(value = "procNo") String procNo, @RequestParam(value = "lotNo") String lotNo, @RequestParam(value = "classNo") String classNo) { try { return pqcInputService.getBatchNumInfo(factory, company,userNo,lineType,procNo,lotNo,classNo); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "一键合格操作", notes = "一键合格操作") @RequestMapping(value = "/setOK", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult setOK( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkId") String checkId) { try { return pqcInputService.setOK(factory, company,userNo,checkId); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "提交/撤回提交/删除", notes = "提交/撤回提交/删除") @RequestMapping(value = "/submitInfo", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult submitInfo( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkId") String checkId, @RequestParam(value = "operaType") String operaType, @RequestParam(value = "remarks") String remarks) { try { return pqcInputService.submitInfo(factory, company,userNo,checkId,operaType,remarks); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "获取checker", notes = "获取checker") @RequestMapping(value = "/getChecker", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getChecker( @RequestParam(value = "checkTask") String checkTask) { try { return pqcInputService.getChecker(checkTask); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "更新选择检验人状态", notes = "更新选择检验人状态") @RequestMapping(value = "/updataChecker", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult updataChecker( @RequestParam(value = "id") String id, @RequestParam(value = "status") String status, @RequestParam(value = "billNo") String billNo) { try { return pqcInputService.updataChecker(id, status, billNo); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "获取从表检验项目明细及丛丛表检验值明细", notes = "获取从表检验项目明细及丛丛表检验值明细") @RequestMapping(value = "/getItemInfo", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getItemInfo( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "checkId") String checkId, @RequestParam(value = "checkItemId") String checkItemId) { try { return pqcInputService.getItemInfo(factory, company,checkId,checkItemId); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "检验值录入", notes = "检验值录入") @RequestMapping(value = "/checkValueInput", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult checkValueInput( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkId") String checkId, @RequestParam(value = "checkItemId") String checkItemId, @RequestParam(value = "testValue") String testValue, @RequestParam(value = "ptype") String ptype, @RequestParam(value = "checkValueId") String checkValueId) { try { return pqcInputService.checkValueInput(factory, company,userNo,checkId,checkItemId,testValue,ptype,checkValueId); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "检验值修改", notes = "检验值修改") @RequestMapping(value = "/checkValueFieldInput", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult checkValueFieldInput( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkId") String checkId, @RequestParam(value = "tableName") String tableName, @RequestParam(value = "changeName") String changeName, @RequestParam(value = "changeValue") String changeValue){ try { return pqcInputService.checkValueFieldInput(factory,company,userNo,checkId,tableName, changeName,changeValue); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "非量化项目的检验值", notes = "非量化项目的检验值") @RequestMapping(value = "/nonQulCheckVal", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult nonQulCheckVal( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "proc") String proc, @RequestParam(value = "prodNo") String prodNo, @RequestParam(value = "prodType") String prodType, @RequestParam(value = "checkItem") String checkItem) { try { return pqcInputService.nonQulCheckVal(factory,company,proc,prodNo,prodType,checkItem); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "PQC值修改", notes = "PQC值修改") @RequestMapping(value = "/modifyPQCValue", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult modifyPQCValue( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "mid") String mid, @RequestParam(value = "tableName") String tableName, @RequestParam(value = "changeName") String changeName, @RequestParam(value = "changeValue") String changeValue){ try { return pqcInputService.modifyPQCValue(factory,company,userNo,mid,tableName, changeName,changeValue); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "PQC值修改-有返回值", notes = "PQC值修改-有返回值") @RequestMapping(value = "/modifyPQCValue1", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult modifyPQCValue1( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "mid") String mid, @RequestParam(value = "tableName") String tableName, @RequestParam(value = "changeName") String changeName, @RequestParam(value = "changeValue") String changeValue){ try { return pqcInputService.modifyPQCValue1(factory,company,userNo,mid,tableName, changeName,changeValue); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "信息查看权限设置", notes = "信息查看权限设置") @RequestMapping(value = "/getAuthority", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getAuthority( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "procNo") String procNo){ try { return pqcInputService.getAuthority(factory,company,procNo); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "PQC检验项目录入 —— 一键斜杠", notes = "PQC检验项目录入 —— 一键斜杠") @RequestMapping(value = "/setXieGang", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult setXieGang( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "pid") String pid){ try { return pqcInputService.setXieGang(factory,company,userNo,pid); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "获取检验值明细的【上一项】和【下一项】", notes = "获取检验值明细的【上一项】和【下一项】") @RequestMapping(value = "/goNextItem", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult goNextItem( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "ftype") String ftype, @RequestParam(value = "mid") String mid, @RequestParam(value = "pid") String pid) { try { return pqcInputService.goNextItem(factory, company,ftype,mid,pid); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "PQC首检项目-列表", notes = "PQC首检项目-列表") @RequestMapping(value = "/getPQCItemList", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getPQCItemList( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "keyword") String keyword, @RequestParam(value = "page") int page, @RequestParam(value = "size") int size){ try { return pqcInputService.getPQCItemList(factory,company,userNo,keyword,page,size); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "修改PQC首检项目-列表", notes = "修改PQC首检项目-列表") @RequestMapping(value = "/sumbitPQCItem", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult sumbitPQCItem( @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){ try { return pqcInputService.sumbitPQCItem(factory,company,mid,userNo,operaType); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "获取合格结果", notes = "获取合格结果") @RequestMapping(value = "/getOkResult", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getOkResult( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "mid") String mid){ try { return pqcInputService.getOkResult(factory,company,userNo,mid); } 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 = "user") String user, @RequestParam(value = "ftype") String ftype, @RequestParam(value = "mid") String mid, @RequestParam(value = "keyword") String keyword, @RequestParam(value = "size") int size, @RequestParam(value = "page") int page){ try { return pqcInputService.getRecordList(factory,company,user,ftype,mid,keyword,size,page); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "一键符合要求", notes = "一键要求操作") @RequestMapping(value = "/updateRequisito", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult updateRequisito( @RequestParam(value = "factory") String factory, @RequestParam(value = "company") String company, @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkId") String checkId) { try { return pqcInputService.updateRequisito(factory, company,userNo,checkId); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @ApiOperation(value = "根据检验单号返回数据", notes = "根据检验单号返回数据") @RequestMapping(value = "/getBillReturn", method = RequestMethod.POST, produces = "application/json") @ResponseBody public ApiResponseResult getBillReturn( @RequestParam(value = "billNo") String billNo) { try { return pqcInputService.getBillReturn(billNo); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } }