mirror of
https://gitee.com/yudaocode/yudao-boot-mini.git
synced 2026-10-06 14:13:14 +08:00
Merge branch 'master-jdk17' of https://github.com/YunaiV/ruoyi-vue-pro into master-jdk17
This commit is contained in:
+4
@@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.purchase.vo.in;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -39,6 +41,7 @@ public class ErpPurchaseInSaveReqVO {
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "入库清单列表")
|
||||
@Valid
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
@@ -68,6 +71,7 @@ public class ErpPurchaseInSaveReqVO {
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
@DecimalMin(value = "0", inclusive = false, message = "产品数量必须大于 0")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "税率,百分比", example = "99.88")
|
||||
|
||||
+4
@@ -36,6 +36,10 @@ public interface ErpStockMapper extends BaseMapperX<ErpStockDO> {
|
||||
}
|
||||
|
||||
default int updateCountIncrement(Long id, BigDecimal count, boolean negativeEnable) {
|
||||
// 数量为 0 无库存增量(历史脏数据防护):直接跳过,避免生成空 SET 的 UPDATE 抛异常 500
|
||||
if (count.compareTo(BigDecimal.ZERO) == 0) {
|
||||
return 0;
|
||||
}
|
||||
LambdaUpdateWrapper<ErpStockDO> updateWrapper = new LambdaUpdateWrapper<ErpStockDO>()
|
||||
.eq(ErpStockDO::getId, id);
|
||||
if (count.compareTo(BigDecimal.ZERO) > 0) {
|
||||
|
||||
Reference in New Issue
Block a user