Commit 5ecec3eb by 陈皓

init

parent 627e5035
......@@ -20,6 +20,8 @@ import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
import java.util.stream.Collectors;
......@@ -58,10 +60,12 @@ public class ImageBatchController {
return ResultVo.success(0);
}
long complete = imageDetectionDao.selectCount(
Wrappers.lambdaQuery(ImageDetection.builder().batchId(id).build()).isNotNull(ImageDetection::getQualified)
Wrappers.lambdaQuery(ImageDetection.builder().batchId(id).build()).in(ImageDetection::getQualified, 0,1)
);
return ResultVo.success(Convert.toInt(complete / count) * 100);
BigDecimal countDecimal = new BigDecimal(count);
BigDecimal completeDecimal = new BigDecimal(complete);
BigDecimal res = completeDecimal.divide(countDecimal, 2, RoundingMode.HALF_UP);
return ResultVo.success(Convert.toInt(res.doubleValue() * 100));
}
@ApiOperation("根据ID查询")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment