From 9d4d258a84fc8bab1b5e8a03b3988e791a83e7f2 Mon Sep 17 00:00:00 2001 From: dimengzhe <251008545@qq.com> Date: Wed, 6 Apr 2022 14:32:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E5=85=A5=E5=BA=93=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=85=A5=E5=BA=93=E6=8E=A5=E5=8F=A3=E5=8F=8A=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scm/api/scmvehicleinbound/ScmVehicleInboundDto.java | 8 ++++++++ .../scm/api/scmvehicleinbound/ScmVehicleInboundFeign.java | 4 +++- .../biz/scmvehicleinbound/ScmVehicleInboundService.java | 7 ++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinbound/ScmVehicleInboundDto.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinbound/ScmVehicleInboundDto.java index 7dbba672a9..9c45a7479f 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinbound/ScmVehicleInboundDto.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinbound/ScmVehicleInboundDto.java @@ -1,9 +1,12 @@ package com.yxt.anrui.scm.api.scmvehicleinbound; +import com.fasterxml.jackson.annotation.JsonFormat; import com.yxt.common.core.dto.Dto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.util.Date; /** @@ -15,12 +18,17 @@ import java.util.Date; public class ScmVehicleInboundDto implements Dto { private static final long serialVersionUID = 8881859025299917313L; @ApiModelProperty(value = "sid") + @NotBlank(message = "请选择要入库的数据") private String sid; @ApiModelProperty(value = "入库日期") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @NotNull(message = "入库日期不能为空") private Date inboundDate; @ApiModelProperty(value = "入库人") + @NotBlank(message = "入库人不能为空") private String inbound; @ApiModelProperty(value = "库位") + @NotBlank(message = "库位不能为空") private String warehouseCode; @ApiModelProperty(value = "车辆库位照片") private String inboundPhoto; diff --git a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinbound/ScmVehicleInboundFeign.java b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinbound/ScmVehicleInboundFeign.java index 28a5b65649..e1a1601457 100644 --- a/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinbound/ScmVehicleInboundFeign.java +++ b/anrui-scm/anrui-scm-api/src/main/java/com/yxt/anrui/scm/api/scmvehicleinbound/ScmVehicleInboundFeign.java @@ -7,6 +7,8 @@ import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; + /** * @Author dimengzhe * @Date 2022/4/6 10:38 @@ -32,5 +34,5 @@ public interface ScmVehicleInboundFeign { @ApiOperation("入库") @PutMapping("/update") @ResponseBody - ResultBean update(@RequestBody ScmVehicleInboundDto scmVehicleInboundDto); + ResultBean update(@Valid @RequestBody ScmVehicleInboundDto scmVehicleInboundDto); } diff --git a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinbound/ScmVehicleInboundService.java b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinbound/ScmVehicleInboundService.java index a738fc261f..b568bc6a17 100644 --- a/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinbound/ScmVehicleInboundService.java +++ b/anrui-scm/anrui-scm-biz/src/main/java/com/yxt/anrui/scm/biz/scmvehicleinbound/ScmVehicleInboundService.java @@ -13,6 +13,8 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Date; + /** * @Author dimengzhe * @Date 2022/4/6 10:55 @@ -114,7 +116,10 @@ public class ScmVehicleInboundService extends MybatisBaseService