feat:载具信息新增
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cn.code.nl.module.base.controller.api;
|
||||
package cn.code.nl.module.base.api;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.module.base.api.codegen.CodeGenApi;
|
||||
import cn.code.nl.module.base.api.codegen.dto.CodeGenerateReqDTO;
|
||||
import cn.code.nl.module.base.service.codegen.CodeGenService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -26,7 +27,7 @@ import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
@RestController
|
||||
@RequestMapping("/rpc-api/base/code-gen")
|
||||
@Validated
|
||||
public class CodeGenController {
|
||||
public class CodeGenController implements CodeGenApi {
|
||||
|
||||
@Resource
|
||||
private CodeGenService codeGenService;
|
||||
@@ -36,6 +37,7 @@ public class CodeGenController {
|
||||
*/
|
||||
@PostMapping("/generate")
|
||||
@Operation(summary = "生成编码")
|
||||
@Override
|
||||
public CommonResult<String> generate(@Valid @RequestBody CodeGenerateReqDTO reqDTO) {
|
||||
String code = codeGenService.generate(reqDTO.getRuleCode());
|
||||
return success(code);
|
||||
@@ -43,9 +45,9 @@ public class CodeGenController {
|
||||
|
||||
@GetMapping("/preview")
|
||||
@Operation(summary = "预览下一个编码(不消耗序号)")
|
||||
@Override
|
||||
public CommonResult<String> preview(@RequestParam("ruleCode") String ruleCode) {
|
||||
String code = codeGenService.preview(ruleCode);
|
||||
return success(code);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package cn.code.nl.module.base.dal.mysql.codegen;
|
||||
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.code.nl.module.base.dal.dataobject.codegen.CodeSequenceDO;
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -35,6 +36,7 @@ public interface CodeSequenceMapper extends BaseMapperX<CodeSequenceDO> {
|
||||
* @param maxValue 最大值上限
|
||||
* @return 更新行数
|
||||
*/
|
||||
@InterceptorIgnore(dataPermission = "true")
|
||||
int updateCurrentValueBySegment(@Param("ruleId") Long ruleId,
|
||||
@Param("resetKey") String resetKey,
|
||||
@Param("step") int step,
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -13,7 +13,6 @@ public class StorageVehicleInfoSaveReqVO {
|
||||
private Long storageVehicleId;
|
||||
|
||||
@Schema(description = "载具编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "载具编码不能为空")
|
||||
private String storageVehicleCode;
|
||||
|
||||
@Schema(description = "载具名称")
|
||||
@@ -53,8 +52,4 @@ public class StorageVehicleInfoSaveReqVO {
|
||||
@NotNull(message = "占仓位数不能为空")
|
||||
private Integer occupyStructQty;
|
||||
|
||||
@Schema(description = "木箱号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "木箱号不能为空")
|
||||
private String boxNo;
|
||||
|
||||
}
|
||||
@@ -1,89 +1,85 @@
|
||||
package cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.code.nl.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 载具信息 DO
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@TableName("wms_storage_vehicle_info")
|
||||
@KeySequence("wms_storage_vehicle_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StorageVehicleInfoDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 载具标识
|
||||
*/
|
||||
@TableId
|
||||
private Long storageVehicleId;
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String storageVehicleCode;
|
||||
/**
|
||||
* 载具名称
|
||||
*/
|
||||
private String storageVehicleName;
|
||||
/**
|
||||
* 一维码
|
||||
*/
|
||||
private String oneCode;
|
||||
/**
|
||||
* 二维码
|
||||
*/
|
||||
private String twoCode;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean isUsed;
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
private String storageVehicleType;
|
||||
/**
|
||||
* 载具宽度
|
||||
*/
|
||||
private Integer vehicleWidth;
|
||||
/**
|
||||
* 载具长度
|
||||
*/
|
||||
private Integer vehicleLong;
|
||||
/**
|
||||
* 载具高度
|
||||
*/
|
||||
private Integer vehicleHeight;
|
||||
/**
|
||||
* 托盘重量
|
||||
*/
|
||||
private BigDecimal weigth;
|
||||
/**
|
||||
* 载具是否超仓位
|
||||
*/
|
||||
private String overStructType;
|
||||
/**
|
||||
* 占仓位数
|
||||
*/
|
||||
private Integer occupyStructQty;
|
||||
/**
|
||||
* 木箱号
|
||||
*/
|
||||
private String boxNo;
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String extId;
|
||||
|
||||
|
||||
}
|
||||
package cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.code.nl.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 载具信息 DO
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@TableName("wms_storage_vehicle_info")
|
||||
@KeySequence("wms_storage_vehicle_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class StorageVehicleInfoDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 载具标识
|
||||
*/
|
||||
@TableId
|
||||
private Long storageVehicleId;
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String storageVehicleCode;
|
||||
/**
|
||||
* 载具名称
|
||||
*/
|
||||
private String storageVehicleName;
|
||||
/**
|
||||
* 一维码
|
||||
*/
|
||||
private String oneCode;
|
||||
/**
|
||||
* 二维码
|
||||
*/
|
||||
private String twoCode;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean isUsed;
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
private String storageVehicleType;
|
||||
/**
|
||||
* 载具宽度
|
||||
*/
|
||||
private Integer vehicleWidth;
|
||||
/**
|
||||
* 载具长度
|
||||
*/
|
||||
private Integer vehicleLong;
|
||||
/**
|
||||
* 载具高度
|
||||
*/
|
||||
private Integer vehicleHeight;
|
||||
/**
|
||||
* 托盘重量
|
||||
*/
|
||||
private BigDecimal weigth;
|
||||
/**
|
||||
* 载具是否超仓位
|
||||
*/
|
||||
private String overStructType;
|
||||
/**
|
||||
* 占仓位数
|
||||
*/
|
||||
private Integer occupyStructQty;
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String extId;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ public interface StorageVehicleInfoMapper extends BaseMapperX<StorageVehicleInfo
|
||||
.eqIfPresent(StorageVehicleInfoDO::getWeigth, reqVO.getWeigth())
|
||||
.eqIfPresent(StorageVehicleInfoDO::getOverStructType, reqVO.getOverStructType())
|
||||
.eqIfPresent(StorageVehicleInfoDO::getOccupyStructQty, reqVO.getOccupyStructQty())
|
||||
.eqIfPresent(StorageVehicleInfoDO::getBoxNo, reqVO.getBoxNo())
|
||||
.betweenIfPresent(StorageVehicleInfoDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(StorageVehicleInfoDO::getStorageVehicleId));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @Author: liyongde
|
||||
* @Date: 2026/7/22 13:50
|
||||
*/
|
||||
@Configuration(value = "wmsRpcConfiguration", proxyBeanMethods = false)
|
||||
@EnableFeignClients(clients = {CodeGenApi.class})
|
||||
public class RpcConfiguration {
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package cn.code.nl.module.wms.service.storagevehicleinfo;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.module.base.api.codegen.CodeGenApi;
|
||||
import cn.code.nl.module.base.api.codegen.dto.CodeGenerateReqDTO;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
@@ -32,12 +35,19 @@ public class StorageVehicleInfoServiceImpl implements StorageVehicleInfoService
|
||||
@Resource
|
||||
private StorageVehicleInfoMapper storageVehicleInfoMapper;
|
||||
|
||||
@Resource
|
||||
private CodeGenApi codeGenApi;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createStorageVehicleInfo(StorageVehicleInfoSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
StorageVehicleInfoDO storageVehicleInfo = BeanUtils.toBean(createReqVO, StorageVehicleInfoDO.class);
|
||||
CodeGenerateReqDTO codeGenerateReqDTO = new CodeGenerateReqDTO();
|
||||
codeGenerateReqDTO.setRuleCode(createReqVO.getStorageVehicleType() + "_CODE");
|
||||
CommonResult<String> generate = codeGenApi.generate(codeGenerateReqDTO);
|
||||
storageVehicleInfo.setStorageVehicleCode(generate.getData());
|
||||
storageVehicleInfoMapper.insert(storageVehicleInfo);
|
||||
|
||||
// 返回
|
||||
return storageVehicleInfo.getStorageVehicleId();
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ export namespace WmsStorageVehicleInfoApi {
|
||||
weigth: number; // 托盘重量
|
||||
overStructType?: string; // 载具是否超仓位
|
||||
occupyStructQty?: number; // 占仓位数
|
||||
boxNo?: string; // 木箱号
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -134,14 +134,6 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
placeholder: '请输入占仓位数',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'boxNo',
|
||||
label: '木箱号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入木箱号',
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
@@ -251,15 +243,6 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
placeholder: '请输入占仓位数',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'boxNo',
|
||||
label: '木箱号',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请输入木箱号',
|
||||
},
|
||||
},
|
||||
{
|
||||
fieldName: 'createTime',
|
||||
label: '创建时间',
|
||||
@@ -348,11 +331,6 @@ export function useGridColumns(): VxeTableGridOptions<WmsStorageVehicleInfoApi.S
|
||||
title: '占仓位数',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'boxNo',
|
||||
title: '木箱号',
|
||||
minWidth: 120,
|
||||
},
|
||||
{
|
||||
field: 'extId',
|
||||
title: '外部标识',
|
||||
|
||||
Reference in New Issue
Block a user