package com.web.pda.lyt.lytPda.controller; import com.app.base.data.ApiResponseResult; import com.web.pda.lyt.lytPda.service.internal.SJPatrolServiceImpl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @RequestMapping("SJPatrol") @RestController public class SJPatrolController { @Autowired private SJPatrolServiceImpl SJPatrolService; /* @PostMapping("getAll")*/ @RequestMapping(value ="/getAll", method = RequestMethod.POST) public ApiResponseResult getAll(@RequestParam(value = "userNo") String userNo, @RequestParam(value = "taskNo") String taskNo) throws Exception { return SJPatrolService.getBillSelect(userNo, taskNo); } @PostMapping("getDetails") public ApiResponseResult getDetails( @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkNo") String checkNo, @RequestParam(value = "pid") int pid ) { try { return SJPatrolService.getDetails(userNo, checkNo, pid); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @PostMapping("checkSave") public ApiResponseResult checkSave( @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkNo") String checkNo, @RequestParam(value = "pid") int pid, @RequestParam(value = "checkResult") String checkResult, @RequestParam(value = "checkDemo") String checkDemo, @RequestParam(value = "checkNum") String checkNum ) { try { return SJPatrolService.checkDetailSave(userNo, checkNo, pid, checkResult, checkDemo, checkNum); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @PostMapping("submit") public ApiResponseResult submit( @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkNo") String checkNo, @RequestParam(value = "type") int type ) { try { return SJPatrolService.submitData(userNo, checkNo, type); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @PostMapping("getSJAll") public ApiResponseResult getSJAll(@RequestParam(value = "userNo") String userNo, @RequestParam(value = "taskNo") String taskNo) throws Exception { return SJPatrolService.getSJBillSelect(userNo, taskNo); } @PostMapping("getSJDetails") public ApiResponseResult getSJDetails( @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkNo") String checkNo, @RequestParam(value = "pid") int pid ) { try { return SJPatrolService.getSJDetails(userNo, checkNo, pid); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @PostMapping("SJCheckSave") public ApiResponseResult SJCheckSave( @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkNo") String checkNo, @RequestParam(value = "pid") int pid, @RequestParam(value = "checkResult") String checkResult, @RequestParam(value = "checkDemo") String checkDemo, @RequestParam(value = "checkNum") String checkNum ) { try { return SJPatrolService.checkDetailSaveSJ(userNo, checkNo, pid, checkResult, checkDemo, checkNum); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } @PostMapping("submitSJ") public ApiResponseResult submitSJ( @RequestParam(value = "userNo") String userNo, @RequestParam(value = "checkNo") String checkNo, @RequestParam(value = "type") int type, @RequestParam(value = "conformity") String conformity ) { try { return SJPatrolService.submitDataSJ(userNo, checkNo, type, conformity); } catch (Exception e) { e.printStackTrace(); return ApiResponseResult.failure(e.toString()); } } }