feat:载具信息表
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
package cn.code.nl.module.wms.controller.admin.storagevehicleinfo;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.CommonResult;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
import static cn.code.nl.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.code.nl.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.code.nl.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.code.nl.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo.*;
|
||||
import cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo.StorageVehicleInfoDO;
|
||||
import cn.code.nl.module.wms.service.storagevehicleinfo.StorageVehicleInfoService;
|
||||
|
||||
@Tag(name = "管理后台 - 载具信息")
|
||||
@RestController
|
||||
@RequestMapping("/wms/storage-vehicle-info")
|
||||
@Validated
|
||||
public class StorageVehicleInfoController {
|
||||
|
||||
@Resource
|
||||
private StorageVehicleInfoService storageVehicleInfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建载具信息")
|
||||
@PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:create')")
|
||||
public CommonResult<Long> createStorageVehicleInfo(@Valid @RequestBody StorageVehicleInfoSaveReqVO createReqVO) {
|
||||
return success(storageVehicleInfoService.createStorageVehicleInfo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新载具信息")
|
||||
@PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:update')")
|
||||
public CommonResult<Boolean> updateStorageVehicleInfo(@Valid @RequestBody StorageVehicleInfoSaveReqVO updateReqVO) {
|
||||
storageVehicleInfoService.updateStorageVehicleInfo(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除载具信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:delete')")
|
||||
public CommonResult<Boolean> deleteStorageVehicleInfo(@RequestParam("id") Long id) {
|
||||
storageVehicleInfoService.deleteStorageVehicleInfo(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除载具信息")
|
||||
@PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:delete')")
|
||||
public CommonResult<Boolean> deleteStorageVehicleInfoList(@RequestParam("ids") List<Long> ids) {
|
||||
storageVehicleInfoService.deleteStorageVehicleInfoListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得载具信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:query')")
|
||||
public CommonResult<StorageVehicleInfoRespVO> getStorageVehicleInfo(@RequestParam("id") Long id) {
|
||||
StorageVehicleInfoDO storageVehicleInfo = storageVehicleInfoService.getStorageVehicleInfo(id);
|
||||
return success(BeanUtils.toBean(storageVehicleInfo, StorageVehicleInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得载具信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:query')")
|
||||
public CommonResult<PageResult<StorageVehicleInfoRespVO>> getStorageVehicleInfoPage(@Valid StorageVehicleInfoPageReqVO pageReqVO) {
|
||||
PageResult<StorageVehicleInfoDO> pageResult = storageVehicleInfoService.getStorageVehicleInfoPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, StorageVehicleInfoRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出载具信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('wms:storage-vehicle-info:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportStorageVehicleInfoExcel(@Valid StorageVehicleInfoPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<StorageVehicleInfoDO> list = storageVehicleInfoService.getStorageVehicleInfoPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "载具信息.xls", "数据", StorageVehicleInfoRespVO.class,
|
||||
BeanUtils.toBean(list, StorageVehicleInfoRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.code.nl.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 载具信息分页 Request VO")
|
||||
@Data
|
||||
public class StorageVehicleInfoPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "载具编码")
|
||||
private String storageVehicleCode;
|
||||
|
||||
@Schema(description = "载具名称")
|
||||
private String storageVehicleName;
|
||||
|
||||
@Schema(description = "一维码")
|
||||
private String oneCode;
|
||||
|
||||
@Schema(description = "二维码")
|
||||
private String twoCode;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private Boolean isUsed;
|
||||
|
||||
@Schema(description = "载具类型")
|
||||
private String storageVehicleType;
|
||||
|
||||
@Schema(description = "载具宽度")
|
||||
private Integer vehicleWidth;
|
||||
|
||||
@Schema(description = "载具长度")
|
||||
private Integer vehicleLong;
|
||||
|
||||
@Schema(description = "载具高度")
|
||||
private Integer vehicleHeight;
|
||||
|
||||
@Schema(description = "托盘重量")
|
||||
private BigDecimal weigth;
|
||||
|
||||
@Schema(description = "载具是否超仓位")
|
||||
private String overStructType;
|
||||
|
||||
@Schema(description = "占仓位数")
|
||||
private Integer occupyStructQty;
|
||||
|
||||
@Schema(description = "木箱号")
|
||||
private String boxNo;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 载具信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class StorageVehicleInfoRespVO {
|
||||
|
||||
private Long storageVehicleId;
|
||||
|
||||
@Schema(description = "载具编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("载具编码")
|
||||
private String storageVehicleCode;
|
||||
|
||||
@Schema(description = "载具名称")
|
||||
@ExcelProperty("载具名称")
|
||||
private String storageVehicleName;
|
||||
|
||||
@Schema(description = "一维码")
|
||||
@ExcelProperty("一维码")
|
||||
private String oneCode;
|
||||
|
||||
@Schema(description = "二维码")
|
||||
@ExcelProperty("二维码")
|
||||
private String twoCode;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启用")
|
||||
private Boolean isUsed;
|
||||
|
||||
@Schema(description = "载具类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("载具类型")
|
||||
private String storageVehicleType;
|
||||
|
||||
@Schema(description = "载具宽度")
|
||||
@ExcelProperty("载具宽度")
|
||||
private Integer vehicleWidth;
|
||||
|
||||
@Schema(description = "载具长度")
|
||||
@ExcelProperty("载具长度")
|
||||
private Integer vehicleLong;
|
||||
|
||||
@Schema(description = "载具高度")
|
||||
@ExcelProperty("载具高度")
|
||||
private Integer vehicleHeight;
|
||||
|
||||
@Schema(description = "托盘重量")
|
||||
@ExcelProperty("托盘重量")
|
||||
private BigDecimal weigth;
|
||||
|
||||
@Schema(description = "载具是否超仓位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("载具是否超仓位")
|
||||
private String overStructType;
|
||||
|
||||
@Schema(description = "占仓位数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("占仓位数")
|
||||
private Integer occupyStructQty;
|
||||
|
||||
@Schema(description = "木箱号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("木箱号")
|
||||
private String boxNo;
|
||||
|
||||
@Schema(description = "外部标识")
|
||||
@ExcelProperty("外部标识")
|
||||
private String extId;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
@ExcelProperty("创建者")
|
||||
private String creator;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新者")
|
||||
@ExcelProperty("更新者")
|
||||
private String updater;
|
||||
|
||||
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 载具信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class StorageVehicleInfoSaveReqVO {
|
||||
|
||||
private Long storageVehicleId;
|
||||
|
||||
@Schema(description = "载具编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "载具编码不能为空")
|
||||
private String storageVehicleCode;
|
||||
|
||||
@Schema(description = "载具名称")
|
||||
private String storageVehicleName;
|
||||
|
||||
@Schema(description = "一维码")
|
||||
private String oneCode;
|
||||
|
||||
@Schema(description = "二维码")
|
||||
private String twoCode;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启用不能为空")
|
||||
private Boolean isUsed;
|
||||
|
||||
@Schema(description = "载具类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "载具类型不能为空")
|
||||
private String storageVehicleType;
|
||||
|
||||
@Schema(description = "载具宽度")
|
||||
private Integer vehicleWidth;
|
||||
|
||||
@Schema(description = "载具长度")
|
||||
private Integer vehicleLong;
|
||||
|
||||
@Schema(description = "载具高度")
|
||||
private Integer vehicleHeight;
|
||||
|
||||
@Schema(description = "托盘重量")
|
||||
private BigDecimal weigth;
|
||||
|
||||
@Schema(description = "载具是否超仓位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "载具是否超仓位不能为空")
|
||||
private String overStructType;
|
||||
|
||||
@Schema(description = "占仓位数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "占仓位数不能为空")
|
||||
private Integer occupyStructQty;
|
||||
|
||||
@Schema(description = "木箱号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "木箱号不能为空")
|
||||
private String boxNo;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
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;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package cn.code.nl.module.wms.dal.mysql.storagevehicleinfo;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.code.nl.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo.StorageVehicleInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo.*;
|
||||
|
||||
/**
|
||||
* 载具信息 Mapper
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@Mapper
|
||||
public interface StorageVehicleInfoMapper extends BaseMapperX<StorageVehicleInfoDO> {
|
||||
|
||||
default PageResult<StorageVehicleInfoDO> selectPage(StorageVehicleInfoPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<StorageVehicleInfoDO>()
|
||||
.eqIfPresent(StorageVehicleInfoDO::getStorageVehicleCode, reqVO.getStorageVehicleCode())
|
||||
.likeIfPresent(StorageVehicleInfoDO::getStorageVehicleName, reqVO.getStorageVehicleName())
|
||||
.eqIfPresent(StorageVehicleInfoDO::getOneCode, reqVO.getOneCode())
|
||||
.eqIfPresent(StorageVehicleInfoDO::getTwoCode, reqVO.getTwoCode())
|
||||
.eqIfPresent(StorageVehicleInfoDO::getIsUsed, reqVO.getIsUsed())
|
||||
.eqIfPresent(StorageVehicleInfoDO::getStorageVehicleType, reqVO.getStorageVehicleType())
|
||||
.eqIfPresent(StorageVehicleInfoDO::getVehicleWidth, reqVO.getVehicleWidth())
|
||||
.eqIfPresent(StorageVehicleInfoDO::getVehicleLong, reqVO.getVehicleLong())
|
||||
.eqIfPresent(StorageVehicleInfoDO::getVehicleHeight, reqVO.getVehicleHeight())
|
||||
.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,62 @@
|
||||
package cn.code.nl.module.wms.service.storagevehicleinfo;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo.*;
|
||||
import cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo.StorageVehicleInfoDO;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 载具信息 Service 接口
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
public interface StorageVehicleInfoService {
|
||||
|
||||
/**
|
||||
* 创建载具信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createStorageVehicleInfo(@Valid StorageVehicleInfoSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新载具信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateStorageVehicleInfo(@Valid StorageVehicleInfoSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除载具信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteStorageVehicleInfo(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除载具信息
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteStorageVehicleInfoListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得载具信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 载具信息
|
||||
*/
|
||||
StorageVehicleInfoDO getStorageVehicleInfo(Long id);
|
||||
|
||||
/**
|
||||
* 获得载具信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 载具信息分页
|
||||
*/
|
||||
PageResult<StorageVehicleInfoDO> getStorageVehicleInfoPage(StorageVehicleInfoPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package cn.code.nl.module.wms.service.storagevehicleinfo;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.code.nl.module.wms.controller.admin.storagevehicleinfo.vo.*;
|
||||
import cn.code.nl.module.wms.dal.dataobject.storagevehicleinfo.StorageVehicleInfoDO;
|
||||
import cn.code.nl.framework.common.pojo.PageResult;
|
||||
import cn.code.nl.framework.common.pojo.PageParam;
|
||||
import cn.code.nl.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.code.nl.module.wms.dal.mysql.storagevehicleinfo.StorageVehicleInfoMapper;
|
||||
|
||||
import static cn.code.nl.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.code.nl.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.code.nl.module.wms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 载具信息 Service 实现类
|
||||
*
|
||||
* @author 诺力管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class StorageVehicleInfoServiceImpl implements StorageVehicleInfoService {
|
||||
|
||||
@Resource
|
||||
private StorageVehicleInfoMapper storageVehicleInfoMapper;
|
||||
|
||||
@Override
|
||||
public Long createStorageVehicleInfo(StorageVehicleInfoSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
StorageVehicleInfoDO storageVehicleInfo = BeanUtils.toBean(createReqVO, StorageVehicleInfoDO.class);
|
||||
storageVehicleInfoMapper.insert(storageVehicleInfo);
|
||||
|
||||
// 返回
|
||||
return storageVehicleInfo.getStorageVehicleId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStorageVehicleInfo(StorageVehicleInfoSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateStorageVehicleInfoExists(updateReqVO.getStorageVehicleId());
|
||||
// 更新
|
||||
StorageVehicleInfoDO updateObj = BeanUtils.toBean(updateReqVO, StorageVehicleInfoDO.class);
|
||||
storageVehicleInfoMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteStorageVehicleInfo(Long id) {
|
||||
// 校验存在
|
||||
validateStorageVehicleInfoExists(id);
|
||||
// 删除
|
||||
storageVehicleInfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteStorageVehicleInfoListByIds(List<Long> ids) {
|
||||
// 删除
|
||||
storageVehicleInfoMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateStorageVehicleInfoExists(Long id) {
|
||||
if (storageVehicleInfoMapper.selectById(id) == null) {
|
||||
throw exception(STORAGE_VEHICLE_INFO_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageVehicleInfoDO getStorageVehicleInfo(Long id) {
|
||||
return storageVehicleInfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<StorageVehicleInfoDO> getStorageVehicleInfoPage(StorageVehicleInfoPageReqVO pageReqVO) {
|
||||
return storageVehicleInfoMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.code.nl.module.wms.dal.mysql.groupplate.GroupPlateMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.code.nl.module.wms.dal.mysql.storagevehicleinfo.StorageVehicleInfoMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user