feat: 定义出库单聚合创建契约
This commit is contained in:
@@ -42,6 +42,11 @@
|
||||
<artifactId>nl-module-task-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.nl.cloud</groupId>
|
||||
<artifactId>nl-module-base-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 业务组件 -->
|
||||
<dependency>
|
||||
@@ -146,4 +151,4 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package cn.code.nl.module.wms.controller.admin.iostorinv.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 出库单新增 Request VO")
|
||||
@Data
|
||||
public class IostorInvCreateReqVO {
|
||||
|
||||
@Schema(description = "单据类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "单据类型不能为空")
|
||||
private String billType;
|
||||
|
||||
@Schema(description = "仓库标识", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "仓库标识不能为空")
|
||||
private String storId;
|
||||
|
||||
@Schema(description = "业务日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "业务日期不能为空")
|
||||
private LocalDateTime bizDate;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "出库单明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "出库单明细不能为空")
|
||||
@Valid
|
||||
private List<Detail> details;
|
||||
|
||||
@Schema(description = "出库单明细")
|
||||
@Data
|
||||
public static class Detail {
|
||||
|
||||
@Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "物料编码不能为空")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "物料标识")
|
||||
private String materialId;
|
||||
|
||||
@Schema(description = "批次序列号")
|
||||
private String pcsn;
|
||||
|
||||
@Schema(description = "计划数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "计划数量不能为空")
|
||||
@DecimalMin(value = "0.001", message = "计划数量不能小于 0.001")
|
||||
private BigDecimal planQty;
|
||||
|
||||
@Schema(description = "数量单位标识")
|
||||
private String qtyUnitId;
|
||||
|
||||
@Schema(description = "数量单位名称")
|
||||
private String qtyUnitName;
|
||||
|
||||
@Schema(description = "来源单据编号")
|
||||
private String sourceBillCode;
|
||||
|
||||
@Schema(description = "来源单据类型")
|
||||
private String sourceBillType;
|
||||
|
||||
@Schema(description = "来源单据明细标识")
|
||||
private String sourceBilldtlId;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package cn.code.nl.module.wms.framework.rpc.config;
|
||||
|
||||
import cn.code.nl.module.base.api.codegen.CodeGenApi;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration(value = "wmsRpcConfiguration", proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = CodeGenApi.class)
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
@@ -14,6 +14,14 @@ import cn.code.nl.framework.common.pojo.PageParam;
|
||||
*/
|
||||
public interface IostorInvService {
|
||||
|
||||
/**
|
||||
* 创建出库单
|
||||
*
|
||||
* @param reqVO 出库单创建信息
|
||||
* @return 出库单编号
|
||||
*/
|
||||
String createOutbound(@Valid IostorInvCreateReqVO reqVO);
|
||||
|
||||
/**
|
||||
* 创建出入库单主表
|
||||
*
|
||||
|
||||
@@ -32,6 +32,11 @@ public class IostorInvServiceImpl implements IostorInvService {
|
||||
@Resource
|
||||
private IostorInvMapper iostorInvMapper;
|
||||
|
||||
@Override
|
||||
public String createOutbound(IostorInvCreateReqVO reqVO) {
|
||||
throw new UnsupportedOperationException("出库单聚合保存功能尚未实现");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createIostorInv(IostorInvSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.code.nl.module.wms.service.iostorinv;
|
||||
|
||||
import cn.code.nl.module.wms.controller.admin.iostorinv.vo.IostorInvCreateReqVO;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.ConstraintViolationException;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.ActiveProfiles;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
@SpringBootTest
|
||||
@ActiveProfiles("local")
|
||||
class IostorInvServiceLocalSpringTest {
|
||||
|
||||
@Resource
|
||||
private IostorInvService iostorInvService;
|
||||
|
||||
@Test
|
||||
void createOutboundShouldRejectEmptyRequest() {
|
||||
IostorInvCreateReqVO reqVO = new IostorInvCreateReqVO();
|
||||
|
||||
assertThrows(ConstraintViolationException.class, () -> iostorInvService.createOutbound(reqVO));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user