XiaoRuby
2023-09-24 20956b0f05f81ca47cf6c3e8f9b3b426e9cfd035
inspect-server/src/main/java/com/yuanchu/mom/controller/RawInspectController.java
@@ -79,16 +79,17 @@
    @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("/updateRawInspectsById/{id}")
    public Result updateRawInspectsById(@PathVariable Integer id) {
    public Result updateRawInspectsById(@PathVariable Integer id,Integer number) {
        //如果已经上报了不能再一次上报
        RawInspect rawInspect = rawInspectService.getById(id);
        if (rawInspect.getInsState() == 1) {
            return Result.fail("已经上报过了,不能再次上报!");
        }
        return Result.success(rawInspectService.updateRawInspectsById(id));
        return Result.success(rawInspectService.updateRawInspectsById(id,number));
    }
}