diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/controller/CheckOrderController.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/controller/CheckOrderController.java new file mode 100644 index 0000000..ab1d46a --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/controller/CheckOrderController.java @@ -0,0 +1,108 @@ +package com.ruoyi.wms.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.ruoyi.common.idempotent.annotation.RepeatSubmit; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.wms.domain.vo.CheckOrderVo; +import com.ruoyi.wms.domain.bo.CheckOrderBo; +import com.ruoyi.wms.service.CheckOrderService; +import com.ruoyi.common.mybatis.core.page.TableDataInfo; + +/** + * 库存盘点单据 + * + * @author zcc + * @date 2024-08-13 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/wms/checkOrder") +public class CheckOrderController extends BaseController { + + private final CheckOrderService checkOrderService; + + /** + * 查询库存盘点单据列表 + */ + @SaCheckPermission("wms:checkOrder:list") + @GetMapping("/list") + public TableDataInfo list(CheckOrderBo bo, PageQuery pageQuery) { + return checkOrderService.queryPageList(bo, pageQuery); + } + + /** + * 导出库存盘点单据列表 + */ + @SaCheckPermission("wms:checkOrder:export") + @Log(title = "库存盘点单据", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(CheckOrderBo bo, HttpServletResponse response) { + List list = checkOrderService.queryList(bo); + ExcelUtil.exportExcel(list, "库存盘点单据", CheckOrderVo.class, response); + } + + /** + * 获取库存盘点单据详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("wms:checkOrder:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(checkOrderService.queryById(id)); + } + + /** + * 新增库存盘点单据 + */ + @SaCheckPermission("wms:checkOrder:add") + @Log(title = "库存盘点单据", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody CheckOrderBo bo) { + checkOrderService.insertByBo(bo); + return R.ok(); + } + + /** + * 修改库存盘点单据 + */ + @SaCheckPermission("wms:checkOrder:edit") + @Log(title = "库存盘点单据", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody CheckOrderBo bo) { + checkOrderService.updateByBo(bo); + return R.ok(); + } + + /** + * 删除库存盘点单据 + * + * @param ids 主键串 + */ + @SaCheckPermission("wms:checkOrder:remove") + @Log(title = "库存盘点单据", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + checkOrderService.deleteByIds(List.of(ids)); + return R.ok(); + } +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/controller/CheckOrderDetailController.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/controller/CheckOrderDetailController.java new file mode 100644 index 0000000..e2d3e36 --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/controller/CheckOrderDetailController.java @@ -0,0 +1,108 @@ +package com.ruoyi.wms.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import com.ruoyi.common.idempotent.annotation.RepeatSubmit; +import com.ruoyi.common.log.annotation.Log; +import com.ruoyi.common.web.core.BaseController; +import com.ruoyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.domain.R; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.excel.utils.ExcelUtil; +import com.ruoyi.wms.domain.vo.CheckOrderDetailVo; +import com.ruoyi.wms.domain.bo.CheckOrderDetailBo; +import com.ruoyi.wms.service.CheckOrderDetailService; +import com.ruoyi.common.mybatis.core.page.TableDataInfo; + +/** + * 库存盘点单据详情 + * + * @author zcc + * @date 2024-08-13 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/wms/checkOrderDetail") +public class CheckOrderDetailController extends BaseController { + + private final CheckOrderDetailService checkOrderDetailService; + + /** + * 查询库存盘点单据详情列表 + */ + @SaCheckPermission("wms:checkOrderDetail:list") + @GetMapping("/list") + public TableDataInfo list(CheckOrderDetailBo bo, PageQuery pageQuery) { + return checkOrderDetailService.queryPageList(bo, pageQuery); + } + + /** + * 导出库存盘点单据详情列表 + */ + @SaCheckPermission("wms:checkOrderDetail:export") + @Log(title = "库存盘点单据详情", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(CheckOrderDetailBo bo, HttpServletResponse response) { + List list = checkOrderDetailService.queryList(bo); + ExcelUtil.exportExcel(list, "库存盘点单据详情", CheckOrderDetailVo.class, response); + } + + /** + * 获取库存盘点单据详情详细信息 + * + * @param id 主键 + */ + @SaCheckPermission("wms:checkOrderDetail:query") + @GetMapping("/{id}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long id) { + return R.ok(checkOrderDetailService.queryById(id)); + } + + /** + * 新增库存盘点单据详情 + */ + @SaCheckPermission("wms:checkOrderDetail:add") + @Log(title = "库存盘点单据详情", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody CheckOrderDetailBo bo) { + checkOrderDetailService.insertByBo(bo); + return R.ok(); + } + + /** + * 修改库存盘点单据详情 + */ + @SaCheckPermission("wms:checkOrderDetail:edit") + @Log(title = "库存盘点单据详情", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody CheckOrderDetailBo bo) { + checkOrderDetailService.updateByBo(bo); + return R.ok(); + } + + /** + * 删除库存盘点单据详情 + * + * @param ids 主键串 + */ + @SaCheckPermission("wms:checkOrderDetail:remove") + @Log(title = "库存盘点单据详情", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] ids) { + checkOrderDetailService.deleteByIds(List.of(ids)); + return R.ok(); + } +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/bo/CheckOrderBo.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/bo/CheckOrderBo.java new file mode 100644 index 0000000..f336957 --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/bo/CheckOrderBo.java @@ -0,0 +1,69 @@ +package com.ruoyi.wms.domain.bo; + +import com.ruoyi.wms.domain.entity.CheckOrder; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import io.github.linpeilie.annotations.AutoMapper; + +import java.math.BigDecimal; + +/** + * 库存盘点单据业务对象 wms_check_order + * + * @author zcc + * @date 2024-08-13 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = CheckOrder.class, reverseConvertGenerate = false) +public class CheckOrderBo extends BaseEntity { + + /** + * + */ + @NotNull(message = "不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 盘点单号 + */ + @NotBlank(message = "盘点单号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String checkOrderNo; + + /** + * 库存盘点单状态 -1:作废 0:未盘库 1:已盘库 + */ + @NotNull(message = "库存盘点单状态 -1:作废 0:未盘库 1:已盘库不能为空", groups = { AddGroup.class, EditGroup.class }) + private Integer checkOrderStatus; + + /** + * 盈亏数 + */ + @NotNull(message = "盈亏数不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal checkOrderTotal; + + /** + * 所属仓库 + */ + @NotNull(message = "所属仓库不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long warehouseId; + + /** + * 所属库区 + */ + @NotNull(message = "所属库区不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long areaId; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + + +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/bo/CheckOrderDetailBo.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/bo/CheckOrderDetailBo.java new file mode 100644 index 0000000..1f30504 --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/bo/CheckOrderDetailBo.java @@ -0,0 +1,81 @@ +package com.ruoyi.wms.domain.bo; + +import com.ruoyi.wms.domain.entity.CheckOrderDetail; +import com.ruoyi.common.core.validate.AddGroup; +import com.ruoyi.common.core.validate.EditGroup; +import com.ruoyi.common.mybatis.core.domain.BaseEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import io.github.linpeilie.annotations.AutoMapper; + +import java.math.BigDecimal; + +/** + * 库存盘点单据详情业务对象 wms_check_order_detail + * + * @author zcc + * @date 2024-08-13 + */ + +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = CheckOrderDetail.class, reverseConvertGenerate = false) +public class CheckOrderDetailBo extends BaseEntity { + + /** + * + */ + @NotNull(message = "不能为空", groups = { EditGroup.class }) + private Long id; + + /** + * 盘点单id + */ + @NotNull(message = "盘点单id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long checkOrderId; + + /** + * 规格id + */ + @NotNull(message = "规格id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long skuId; + + /** + * 库存数量 + */ + @NotNull(message = "库存数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal quantity; + + /** + * 盘点数量 + */ + @NotNull(message = "盘点数量不能为空", groups = { AddGroup.class, EditGroup.class }) + private BigDecimal checkQuantity; + + /** + * 所属仓库 + */ + @NotNull(message = "所属仓库不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long warehouseId; + + /** + * 所属库区 + */ + @NotNull(message = "所属库区不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long areaId; + + /** + * 入库记录id + */ + @NotNull(message = "入库记录id不能为空", groups = { AddGroup.class, EditGroup.class }) + private Long inventoryDetailId; + + /** + * 备注 + */ + @NotBlank(message = "备注不能为空", groups = { AddGroup.class, EditGroup.class }) + private String remark; + + +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/entity/CheckOrder.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/entity/CheckOrder.java new file mode 100644 index 0000000..a37d916 --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/entity/CheckOrder.java @@ -0,0 +1,56 @@ +package com.ruoyi.wms.domain.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.ruoyi.common.mybatis.core.domain.BaseEntity; + +import java.math.BigDecimal; + +import java.io.Serial; + +/** + * 库存盘点单据对象 wms_check_order + * + * @author zcc + * @date 2024-08-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("wms_check_order") +public class CheckOrder extends BaseEntity { + + @Serial + private static final long serialVersionUID=1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + /** + * 盘点单号 + */ + private String checkOrderNo; + /** + * 库存盘点单状态 -1:作废 0:未盘库 1:已盘库 + */ + private Integer checkOrderStatus; + /** + * 盈亏数 + */ + private BigDecimal checkOrderTotal; + /** + * 所属仓库 + */ + private Long warehouseId; + /** + * 所属库区 + */ + private Long areaId; + /** + * 备注 + */ + private String remark; + +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/entity/CheckOrderDetail.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/entity/CheckOrderDetail.java new file mode 100644 index 0000000..927486d --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/entity/CheckOrderDetail.java @@ -0,0 +1,64 @@ +package com.ruoyi.wms.domain.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import com.ruoyi.common.mybatis.core.domain.BaseEntity; + +import java.math.BigDecimal; + +import java.io.Serial; + +/** + * 库存盘点单据详情对象 wms_check_order_detail + * + * @author zcc + * @date 2024-08-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("wms_check_order_detail") +public class CheckOrderDetail extends BaseEntity { + + @Serial + private static final long serialVersionUID=1L; + + /** + * + */ + @TableId(value = "id") + private Long id; + /** + * 盘点单id + */ + private Long checkOrderId; + /** + * 规格id + */ + private Long skuId; + /** + * 库存数量 + */ + private BigDecimal quantity; + /** + * 盘点数量 + */ + private BigDecimal checkQuantity; + /** + * 所属仓库 + */ + private Long warehouseId; + /** + * 所属库区 + */ + private Long areaId; + /** + * 入库记录id + */ + private Long inventoryDetailId; + /** + * 备注 + */ + private String remark; + +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/vo/CheckOrderDetailVo.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/vo/CheckOrderDetailVo.java new file mode 100644 index 0000000..af92f99 --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/vo/CheckOrderDetailVo.java @@ -0,0 +1,84 @@ +package com.ruoyi.wms.domain.vo; + +import java.math.BigDecimal; +import com.ruoyi.wms.domain.entity.CheckOrderDetail; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import lombok.Data; +import io.github.linpeilie.annotations.AutoMapper; + +import java.io.Serializable; +import java.io.Serial; + +/** + * 库存盘点单据详情视图对象 wms_check_order_detail + * + * @author zcc + * @date 2024-08-13 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = CheckOrderDetail.class) +public class CheckOrderDetailVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 盘点单id + */ + @ExcelProperty(value = "盘点单id") + private Long checkOrderId; + + /** + * 规格id + */ + @ExcelProperty(value = "规格id") + private Long skuId; + + /** + * 库存数量 + */ + @ExcelProperty(value = "库存数量") + private BigDecimal quantity; + + /** + * 盘点数量 + */ + @ExcelProperty(value = "盘点数量") + private BigDecimal checkQuantity; + + /** + * 所属仓库 + */ + @ExcelProperty(value = "所属仓库") + private Long warehouseId; + + /** + * 所属库区 + */ + @ExcelProperty(value = "所属库区") + private Long areaId; + + /** + * 入库记录id + */ + @ExcelProperty(value = "入库记录id") + private Long inventoryDetailId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/vo/CheckOrderVo.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/vo/CheckOrderVo.java new file mode 100644 index 0000000..2639d09 --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/domain/vo/CheckOrderVo.java @@ -0,0 +1,72 @@ +package com.ruoyi.wms.domain.vo; + +import java.math.BigDecimal; +import com.ruoyi.wms.domain.entity.CheckOrder; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import com.ruoyi.common.excel.annotation.ExcelDictFormat; +import com.ruoyi.common.excel.convert.ExcelDictConvert; +import lombok.Data; +import io.github.linpeilie.annotations.AutoMapper; + +import java.io.Serializable; +import java.io.Serial; + +/** + * 库存盘点单据视图对象 wms_check_order + * + * @author zcc + * @date 2024-08-13 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = CheckOrder.class) +public class CheckOrderVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * + */ + @ExcelProperty(value = "") + private Long id; + + /** + * 盘点单号 + */ + @ExcelProperty(value = "盘点单号") + private String checkOrderNo; + + /** + * 库存盘点单状态 -1:作废 0:未盘库 1:已盘库 + */ + @ExcelProperty(value = "库存盘点单状态 -1:作废 0:未盘库 1:已盘库") + private Integer checkOrderStatus; + + /** + * 盈亏数 + */ + @ExcelProperty(value = "盈亏数") + private BigDecimal checkOrderTotal; + + /** + * 所属仓库 + */ + @ExcelProperty(value = "所属仓库") + private Long warehouseId; + + /** + * 所属库区 + */ + @ExcelProperty(value = "所属库区") + private Long areaId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/mapper/CheckOrderDetailMapper.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/mapper/CheckOrderDetailMapper.java new file mode 100644 index 0000000..b58c5f6 --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/mapper/CheckOrderDetailMapper.java @@ -0,0 +1,15 @@ +package com.ruoyi.wms.mapper; + +import com.ruoyi.wms.domain.entity.CheckOrderDetail; +import com.ruoyi.wms.domain.vo.CheckOrderDetailVo; +import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 库存盘点单据详情Mapper接口 + * + * @author zcc + * @date 2024-08-13 + */ +public interface CheckOrderDetailMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/mapper/CheckOrderMapper.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/mapper/CheckOrderMapper.java new file mode 100644 index 0000000..0dc13ea --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/mapper/CheckOrderMapper.java @@ -0,0 +1,15 @@ +package com.ruoyi.wms.mapper; + +import com.ruoyi.wms.domain.entity.CheckOrder; +import com.ruoyi.wms.domain.vo.CheckOrderVo; +import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 库存盘点单据Mapper接口 + * + * @author zcc + * @date 2024-08-13 + */ +public interface CheckOrderMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/service/CheckOrderDetailService.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/service/CheckOrderDetailService.java new file mode 100644 index 0000000..c7d77e4 --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/service/CheckOrderDetailService.java @@ -0,0 +1,92 @@ +package com.ruoyi.wms.service; + +import com.ruoyi.common.core.utils.MapstructUtils; +import com.ruoyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.utils.StringUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import com.ruoyi.wms.domain.bo.CheckOrderDetailBo; +import com.ruoyi.wms.domain.vo.CheckOrderDetailVo; +import com.ruoyi.wms.domain.entity.CheckOrderDetail; +import com.ruoyi.wms.mapper.CheckOrderDetailMapper; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 库存盘点单据详情Service业务层处理 + * + * @author zcc + * @date 2024-08-13 + */ +@RequiredArgsConstructor +@Service +public class CheckOrderDetailService { + + private final CheckOrderDetailMapper checkOrderDetailMapper; + + /** + * 查询库存盘点单据详情 + */ + public CheckOrderDetailVo queryById(Long id){ + return checkOrderDetailMapper.selectVoById(id); + } + + /** + * 查询库存盘点单据详情列表 + */ + public TableDataInfo queryPageList(CheckOrderDetailBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = checkOrderDetailMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询库存盘点单据详情列表 + */ + public List queryList(CheckOrderDetailBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return checkOrderDetailMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(CheckOrderDetailBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(bo.getCheckOrderId() != null, CheckOrderDetail::getCheckOrderId, bo.getCheckOrderId()); + lqw.eq(bo.getSkuId() != null, CheckOrderDetail::getSkuId, bo.getSkuId()); + lqw.eq(bo.getQuantity() != null, CheckOrderDetail::getQuantity, bo.getQuantity()); + lqw.eq(bo.getCheckQuantity() != null, CheckOrderDetail::getCheckQuantity, bo.getCheckQuantity()); + lqw.eq(bo.getWarehouseId() != null, CheckOrderDetail::getWarehouseId, bo.getWarehouseId()); + lqw.eq(bo.getAreaId() != null, CheckOrderDetail::getAreaId, bo.getAreaId()); + lqw.eq(bo.getInventoryDetailId() != null, CheckOrderDetail::getInventoryDetailId, bo.getInventoryDetailId()); + return lqw; + } + + /** + * 新增库存盘点单据详情 + */ + public void insertByBo(CheckOrderDetailBo bo) { + CheckOrderDetail add = MapstructUtils.convert(bo, CheckOrderDetail.class); + checkOrderDetailMapper.insert(add); + } + + /** + * 修改库存盘点单据详情 + */ + public void updateByBo(CheckOrderDetailBo bo) { + CheckOrderDetail update = MapstructUtils.convert(bo, CheckOrderDetail.class); + checkOrderDetailMapper.updateById(update); + } + + /** + * 批量删除库存盘点单据详情 + */ + public void deleteByIds(Collection ids) { + checkOrderDetailMapper.deleteBatchIds(ids); + } +} diff --git a/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/service/CheckOrderService.java b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/service/CheckOrderService.java new file mode 100644 index 0000000..b5f995e --- /dev/null +++ b/ruoyi-admin-wms/src/main/java/com/ruoyi/wms/service/CheckOrderService.java @@ -0,0 +1,90 @@ +package com.ruoyi.wms.service; + +import com.ruoyi.common.core.utils.MapstructUtils; +import com.ruoyi.common.mybatis.core.page.TableDataInfo; +import com.ruoyi.common.mybatis.core.page.PageQuery; +import com.ruoyi.common.core.utils.StringUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import com.ruoyi.wms.domain.bo.CheckOrderBo; +import com.ruoyi.wms.domain.vo.CheckOrderVo; +import com.ruoyi.wms.domain.entity.CheckOrder; +import com.ruoyi.wms.mapper.CheckOrderMapper; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 库存盘点单据Service业务层处理 + * + * @author zcc + * @date 2024-08-13 + */ +@RequiredArgsConstructor +@Service +public class CheckOrderService { + + private final CheckOrderMapper checkOrderMapper; + + /** + * 查询库存盘点单据 + */ + public CheckOrderVo queryById(Long id){ + return checkOrderMapper.selectVoById(id); + } + + /** + * 查询库存盘点单据列表 + */ + public TableDataInfo queryPageList(CheckOrderBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = checkOrderMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询库存盘点单据列表 + */ + public List queryList(CheckOrderBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return checkOrderMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(CheckOrderBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(StringUtils.isNotBlank(bo.getCheckOrderNo()), CheckOrder::getCheckOrderNo, bo.getCheckOrderNo()); + lqw.eq(bo.getCheckOrderStatus() != null, CheckOrder::getCheckOrderStatus, bo.getCheckOrderStatus()); + lqw.eq(bo.getCheckOrderTotal() != null, CheckOrder::getCheckOrderTotal, bo.getCheckOrderTotal()); + lqw.eq(bo.getWarehouseId() != null, CheckOrder::getWarehouseId, bo.getWarehouseId()); + lqw.eq(bo.getAreaId() != null, CheckOrder::getAreaId, bo.getAreaId()); + return lqw; + } + + /** + * 新增库存盘点单据 + */ + public void insertByBo(CheckOrderBo bo) { + CheckOrder add = MapstructUtils.convert(bo, CheckOrder.class); + checkOrderMapper.insert(add); + } + + /** + * 修改库存盘点单据 + */ + public void updateByBo(CheckOrderBo bo) { + CheckOrder update = MapstructUtils.convert(bo, CheckOrder.class); + checkOrderMapper.updateById(update); + } + + /** + * 批量删除库存盘点单据 + */ + public void deleteByIds(Collection ids) { + checkOrderMapper.deleteBatchIds(ids); + } +} diff --git a/ruoyi-admin-wms/src/main/resources/mapper/wms/CheckOrderDetailMapper.xml b/ruoyi-admin-wms/src/main/resources/mapper/wms/CheckOrderDetailMapper.xml new file mode 100644 index 0000000..4d775e1 --- /dev/null +++ b/ruoyi-admin-wms/src/main/resources/mapper/wms/CheckOrderDetailMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-admin-wms/src/main/resources/mapper/wms/CheckOrderMapper.xml b/ruoyi-admin-wms/src/main/resources/mapper/wms/CheckOrderMapper.xml new file mode 100644 index 0000000..1c67520 --- /dev/null +++ b/ruoyi-admin-wms/src/main/resources/mapper/wms/CheckOrderMapper.xml @@ -0,0 +1,7 @@ + + + + +