| | |
| | | |
| | | @ApiOperation(value = "上报(更新检验状态)") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class, required = true) |
| | | @ApiImplicitParam(name = "id", value = "检验单id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "number", value = "不合格数量", dataTypeClass = Integer.class) |
| | | }) |
| | | @PostMapping("/updateFinishInspectsById") |
| | | public Result updateFinishInspectsById(@RequestHeader("token") String token, Integer id) throws Exception { |
| | | public Result updateFinishInspectsById(@RequestHeader("token") String token, Integer id,Integer number) throws Exception { |
| | | //如果已经上报了不能再一次上报 |
| | | FinishedInspect finishedInspect = finishedInspectService.getById(id); |
| | | if (ObjectUtils.isNotEmpty(finishedInspect.getResult())) { |
| | | return Result.fail("已经上报过了,不能再次上报!"); |
| | | } |
| | | Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class); |
| | | return Result.success(finishedInspectService.updateFinishInspectsById(data.get("name").replaceAll("\"", ""), id)); |
| | | return Result.success(finishedInspectService.updateFinishInspectsById(data.get("name").replaceAll("\"", ""), id,number)); |
| | | } |
| | | |
| | | @ApiOperation(value = "根据检验单id查询成品检验单详情") |