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