diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsBaseLocationController.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsBaseLocationController.java index 62412e40..148e455f 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsBaseLocationController.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsBaseLocationController.java @@ -114,4 +114,10 @@ public class WmsBaseLocationController extends BaseController { List list = wmsBaseLocationService.queryList(bo); return R.ok(list); } + + @GetMapping("getWmsBaseLocationVoList") + public R> getWmsBaseLocationVoList(WmsBaseLocationBo bo) { + List list = wmsBaseLocationService.queryVoList(bo); + return R.ok(list); + } } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsInventoryCheckController.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsInventoryCheckController.java new file mode 100644 index 00000000..bdad3fe1 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsInventoryCheckController.java @@ -0,0 +1,117 @@ +package org.dromara.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.dromara.wms.domain.bo.WmsInventoryCheckBo; +import org.dromara.wms.domain.vo.WmsInventoryCheckVo; +import org.dromara.wms.service.IWmsInventoryCheckService; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 库存盘点 + * 前端访问路由地址为:/system/inventoryCheck + * + * @author LionLi + * @date 2025-01-10 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/inventoryCheck") +public class WmsInventoryCheckController extends BaseController { + + private final IWmsInventoryCheckService wmsInventoryCheckService; + + /** + * 查询库存盘点列表 + */ + @SaCheckPermission("system:inventoryCheck:list") + @GetMapping("/list") + public TableDataInfo list(WmsInventoryCheckBo bo, PageQuery pageQuery) { + return wmsInventoryCheckService.queryPageList(bo, pageQuery); + } + + /** + * 导出库存盘点列表 + */ + @SaCheckPermission("system:inventoryCheck:export") + @Log(title = "库存盘点", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(WmsInventoryCheckBo bo, HttpServletResponse response) { + List list = wmsInventoryCheckService.queryList(bo); + ExcelUtil.exportExcel(list, "库存盘点", WmsInventoryCheckVo.class, response); + } + + /** + * 获取库存盘点详细信息 + * + * @param inventoryCheckId 主键 + */ + @SaCheckPermission("system:inventoryCheck:query") + @GetMapping("/{inventoryCheckId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long inventoryCheckId) { + return R.ok(wmsInventoryCheckService.queryById(inventoryCheckId)); + } + + /** + * 新增库存盘点 + */ + @SaCheckPermission("system:inventoryCheck:add") + @Log(title = "库存盘点", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@RequestBody WmsInventoryCheckBo bo) { + return toAjax(wmsInventoryCheckService.insertByBo(bo)); + } + + /** + * 修改库存盘点 + */ + @SaCheckPermission("system:inventoryCheck:edit") + @Log(title = "库存盘点", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody WmsInventoryCheckBo bo) { + return toAjax(wmsInventoryCheckService.updateByBo(bo)); + } + + /** + * 删除库存盘点 + * + * @param inventoryCheckIds 主键串 + */ + @SaCheckPermission("system:inventoryCheck:remove") + @Log(title = "库存盘点", businessType = BusinessType.DELETE) + @DeleteMapping("/{inventoryCheckIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] inventoryCheckIds) { + return toAjax(wmsInventoryCheckService.deleteWithValidByIds(List.of(inventoryCheckIds), true)); + } + + + /** + * 下拉框查询库存盘点列表 + */ + + @GetMapping("getWmsInventoryCheckList") + public R> getWmsInventoryChecklist(WmsInventoryCheckBo bo) { + List list = wmsInventoryCheckService.queryList(bo); + return R.ok(list); + } +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsInventoryCheckRecordController.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsInventoryCheckRecordController.java new file mode 100644 index 00000000..2adce771 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsInventoryCheckRecordController.java @@ -0,0 +1,117 @@ +package org.dromara.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.dromara.wms.domain.bo.WmsInventoryCheckRecordBo; +import org.dromara.wms.domain.vo.WmsInventoryCheckRecordVo; +import org.dromara.wms.service.IWmsInventoryCheckRecordService; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 盘点记录和调整工单 + * 前端访问路由地址为:/system/inventoryCheckRecord + * + * @author LionLi + * @date 2025-01-10 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/inventoryCheckRecord") +public class WmsInventoryCheckRecordController extends BaseController { + + private final IWmsInventoryCheckRecordService wmsInventoryCheckRecordService; + + /** + * 查询盘点记录和调整工单列表 + */ + @SaCheckPermission("system:inventoryCheckRecord:list") + @GetMapping("/list") + public TableDataInfo list(WmsInventoryCheckRecordBo bo, PageQuery pageQuery) { + return wmsInventoryCheckRecordService.queryPageList(bo, pageQuery); + } + + /** + * 导出盘点记录和调整工单列表 + */ + @SaCheckPermission("system:inventoryCheckRecord:export") + @Log(title = "盘点记录和调整工单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(WmsInventoryCheckRecordBo bo, HttpServletResponse response) { + List list = wmsInventoryCheckRecordService.queryList(bo); + ExcelUtil.exportExcel(list, "盘点记录和调整工单", WmsInventoryCheckRecordVo.class, response); + } + + /** + * 获取盘点记录和调整工单详细信息 + * + * @param icRecordId 主键 + */ + @SaCheckPermission("system:inventoryCheckRecord:query") + @GetMapping("/{icRecordId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long icRecordId) { + return R.ok(wmsInventoryCheckRecordService.queryById(icRecordId)); + } + + /** + * 新增盘点记录和调整工单 + */ + @SaCheckPermission("system:inventoryCheckRecord:add") + @Log(title = "盘点记录和调整工单", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody WmsInventoryCheckRecordBo bo) { + return toAjax(wmsInventoryCheckRecordService.insertByBo(bo)); + } + + /** + * 修改盘点记录和调整工单 + */ + @SaCheckPermission("system:inventoryCheckRecord:edit") + @Log(title = "盘点记录和调整工单", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody WmsInventoryCheckRecordBo bo) { + return toAjax(wmsInventoryCheckRecordService.updateByBo(bo)); + } + + /** + * 删除盘点记录和调整工单 + * + * @param icRecordIds 主键串 + */ + @SaCheckPermission("system:inventoryCheckRecord:remove") + @Log(title = "盘点记录和调整工单", businessType = BusinessType.DELETE) + @DeleteMapping("/{icRecordIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] icRecordIds) { + return toAjax(wmsInventoryCheckRecordService.deleteWithValidByIds(List.of(icRecordIds), true)); + } + + + /** + * 下拉框查询盘点记录和调整工单列表 + */ + + @GetMapping("getWmsInventoryCheckRecordList") + public R> getWmsInventoryCheckRecordlist(WmsInventoryCheckRecordBo bo) { + List list = wmsInventoryCheckRecordService.queryList(bo); + return R.ok(list); + } +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsInventoryController.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsInventoryController.java index b4074cad..606b1da0 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsInventoryController.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsInventoryController.java @@ -113,4 +113,9 @@ public class WmsInventoryController extends BaseController { BigDecimal bigDecimal = wmsInventoryService.materailCount(materialId); return R.ok(wmsInventoryService.materailCount(materialId)); } + + @GetMapping("/getMaterialInfoList") + public R> getMaterialInfoList(WmsInventoryBo bo) { + return R.ok(wmsInventoryService.getMaterialInfoList(bo)); + } } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsMoveOrderController.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsMoveOrderController.java new file mode 100644 index 00000000..58481472 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsMoveOrderController.java @@ -0,0 +1,117 @@ +package org.dromara.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.dromara.wms.domain.bo.WmsMoveOrderBo; +import org.dromara.wms.domain.vo.WmsMoveOrderVo; +import org.dromara.wms.service.IWmsMoveOrderService; +import org.springframework.web.bind.annotation.*; +import org.springframework.validation.annotation.Validated; +import org.dromara.common.idempotent.annotation.RepeatSubmit; +import org.dromara.common.log.annotation.Log; +import org.dromara.common.web.core.BaseController; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.common.core.domain.R; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import org.dromara.common.log.enums.BusinessType; +import org.dromara.common.excel.utils.ExcelUtil; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 移库工单 + * 前端访问路由地址为:/system/moveOrder + * + * @author LionLi + * @date 2025-01-10 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/moveOrder") +public class WmsMoveOrderController extends BaseController { + + private final IWmsMoveOrderService wmsMoveOrderService; + + /** + * 查询移库工单列表 + */ + @SaCheckPermission("system:moveOrder:list") + @GetMapping("/list") + public TableDataInfo list(WmsMoveOrderBo bo, PageQuery pageQuery) { + return wmsMoveOrderService.queryPageList(bo, pageQuery); + } + + /** + * 导出移库工单列表 + */ + @SaCheckPermission("system:moveOrder:export") + @Log(title = "移库工单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(WmsMoveOrderBo bo, HttpServletResponse response) { + List list = wmsMoveOrderService.queryList(bo); + ExcelUtil.exportExcel(list, "移库工单", WmsMoveOrderVo.class, response); + } + + /** + * 获取移库工单详细信息 + * + * @param moveId 主键 + */ + @SaCheckPermission("system:moveOrder:query") + @GetMapping("/{moveId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long moveId) { + return R.ok(wmsMoveOrderService.queryById(moveId)); + } + + /** + * 新增移库工单 + */ + @SaCheckPermission("system:moveOrder:add") + @Log(title = "移库工单", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody WmsMoveOrderBo bo) { + return toAjax(wmsMoveOrderService.insertByBo(bo)); + } + + /** + * 修改移库工单 + */ + @SaCheckPermission("system:moveOrder:edit") + @Log(title = "移库工单", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody WmsMoveOrderBo bo) { + return toAjax(wmsMoveOrderService.updateByBo(bo)); + } + + /** + * 删除移库工单 + * + * @param moveIds 主键串 + */ + @SaCheckPermission("system:moveOrder:remove") + @Log(title = "移库工单", businessType = BusinessType.DELETE) + @DeleteMapping("/{moveIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] moveIds) { + return toAjax(wmsMoveOrderService.deleteWithValidByIds(List.of(moveIds), true)); + } + + + /** + * 下拉框查询移库工单列表 + */ + + @GetMapping("getWmsMoveOrderList") + public R> getWmsMoveOrderlist(WmsMoveOrderBo bo) { + List list = wmsMoveOrderService.queryList(bo); + return R.ok(list); + } +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsOutstockRecordController.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsOutstockRecordController.java index 656bcaeb..6ca1a0b2 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsOutstockRecordController.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsOutstockRecordController.java @@ -87,7 +87,7 @@ public class WmsOutstockRecordController extends BaseController { @Log(title = "出库记录", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody WmsOutstockRecordBo bo) { + public R edit(@RequestBody WmsOutstockRecordBo bo) { return toAjax(wmsOutstockRecordService.updateByBo(bo)); } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java index 0fc0d25e..b519b362 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java @@ -93,6 +93,8 @@ public class WmsInventory{ private Date updateTime; @TableField(exist = false) private String warehouseCode;//字段映射 + @TableField(exist = false) + private String materialCode;//字段映射 } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventoryCheck.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventoryCheck.java new file mode 100644 index 00000000..5e357bfb --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventoryCheck.java @@ -0,0 +1,112 @@ +package org.dromara.wms.domain; + +import org.dromara.common.tenant.core.TenantEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 库存盘点对象 wms_inventory_check + * + * @author LionLi + * @date 2025-01-10 + */ +@Data +@TableName("wms_inventory_check") +public class WmsInventoryCheck { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 表主键 + */ + private Long inventoryCheckId; + + /** + * 盘点单号 + */ + private String checkCode; + + /** + * 物料大类 + */ + private String materialCategories; + + /** + * 计划仓库ID + */ + private Long planWarehouseId; + + /** + * 盘点类型(1全部,2货架,3物料)) + */ + private String checkType; + + /** + * 盘点状态(0计划,2盘点中,3盘点完成) + */ + private String checkStatus; + + /** + * 审核人 + */ + private String auditBy; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + private String auditStatus; + + /** + * 审核意见 + */ + private String auditComments; + + /** + * 开始时间 + */ + private Date beginTime; + + /** + * 结束时间 + */ + private Date endTime; + /** + * 租户id + */ + private String tenantId; + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + @TableField(exist = false) + private String warehouseCode;//字段映射 + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventoryCheckRecord.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventoryCheckRecord.java new file mode 100644 index 00000000..29a3db9d --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventoryCheckRecord.java @@ -0,0 +1,150 @@ +package org.dromara.wms.domain; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 盘点记录和调整工单对象 wms_inventory_check_record + * + * @author LionLi + * @date 2025-01-10 + */ +@Data +@TableName("wms_inventory_check_record") +public class WmsInventoryCheckRecord { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 盘点记录主键 + */ + private Long icRecordId; + + /** + * 物料大类 + */ + private String materialCategories; + + /** + * 盘点单号 + */ + private String checkCode; + + /** + * 批次码 + */ + private String batchCode; + + /** + * 物料id + */ + private Long materialId; + + /** + * 库位编码 + */ + private String locationCode; + + /** + * 物料编码 + */ + private String materialCode; + + /** + * 物料名称 + */ + private String materialName; + + /** + * 库存数量 + */ + private String inventoryQty; + + /** + * 盘点数量 + */ + private Long checkQty; + + /** + * 盘点状态(0异常,1正常) + */ + private String checkStatus; + + /** + * erp同步状态 + */ + private String erpSynchronousStatus; + + /** + * erp同步数量 + */ + private Long erpSynchronousQty; + + /** + * 是否发起调整(0否,1是) + */ + private String isAdjust; + + /** + * 审核人 + */ + private String auditBy; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + private String auditStatus; + + /** + * 审核意见 + */ + private String auditComments; + + /** + * 调整状态(0待执行,1完成) + */ + private String adjustStatus; + + /** + * 调整类型(1库存调整) + */ + private String adjustType; + /** + * 租户id + */ + private String tenantId; + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsMoveOrder.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsMoveOrder.java new file mode 100644 index 00000000..4001f252 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsMoveOrder.java @@ -0,0 +1,119 @@ +package org.dromara.wms.domain; + +import org.dromara.common.tenant.core.TenantEntity; +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.io.Serial; + +/** + * 移库工单对象 wms_move_order + * + * @author LionLi + * @date 2025-01-10 + */ +@Data +@TableName("wms_move_order") +public class WmsMoveOrder{ + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 表主键 + */ + private Long moveId; + + /** + * 物料ID + */ + private Long materialId; + + /** + * 物料大类 + */ + private String materialCategories; + + /** + * 仓库ID + */ + private Long warehouseId; + + /** + * 计划库位 + */ + private String planLocationCode; + + /** + * 工单状态(0执行中,1完成,2关闭) + */ + private String orderStatus; + + /** + * 目标库位 + */ + private String targetLocationCode; + + /** + * 审核人 + */ + private String auditBy; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + private String auditStatus; + + /** + * 审核意见 + */ + private String auditComments; + + /** + * erp同步状态 + */ + private String erpSynchronousStatus; + + /** + * erp同步数量 + */ + private Long erpSynchronousQty; + /** + * 租户id + */ + private String tenantId; + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + @TableField(exist = false) + private String warehouseCode; + @TableField(exist = false) + private String materialCode; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsOutstockRecord.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsOutstockRecord.java index ee7c1da3..d2af59a4 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsOutstockRecord.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsOutstockRecord.java @@ -1,5 +1,7 @@ package org.dromara.wms.domain; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import com.ibm.icu.math.BigDecimal; import org.dromara.common.tenant.core.TenantEntity; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; @@ -55,7 +57,8 @@ public class WmsOutstockRecord extends TenantEntity { /** * 出库数量 */ - private Long outstockQty; + @TableField(typeHandler = JacksonTypeHandler.class) + private java.math.BigDecimal outstockQty; /** * 物料大类 @@ -70,7 +73,8 @@ public class WmsOutstockRecord extends TenantEntity { /** * erp同步数量 */ - private Long erpSynchronousQty; + @TableField(typeHandler = JacksonTypeHandler.class) + private java.math.BigDecimal erpSynchronousQty; /** @@ -84,4 +88,8 @@ public class WmsOutstockRecord extends TenantEntity { private String materialUnit; @TableField(exist = false) private String materialSpec; + + @TableField(exist = false) + private java.math.BigDecimal returnQty; + private String returnFlag; } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsReturnOrder.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsReturnOrder.java index 7c24b1e7..3b0e0855 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsReturnOrder.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsReturnOrder.java @@ -4,6 +4,8 @@ import org.dromara.common.tenant.core.TenantEntity; import com.baomidou.mybatisplus.annotation.*; import lombok.Data; import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; @@ -45,7 +47,7 @@ public class WmsReturnOrder { /** * 计划数量 */ - private Long planAmount; + private BigDecimal planAmount; /** * 仓库ID @@ -65,7 +67,7 @@ public class WmsReturnOrder { /** * 实际数量 */ - private Long returnAmount; + private BigDecimal returnAmount; /** * 实际退库库位 @@ -127,5 +129,8 @@ public class WmsReturnOrder { private Date updateTime; @TableField(exist = false) private String warehouseCode;//字段映射 + @TableField(exist = false) + private String materialCode; + } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsInventoryCheckBo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsInventoryCheckBo.java new file mode 100644 index 00000000..efe492d2 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsInventoryCheckBo.java @@ -0,0 +1,92 @@ +package org.dromara.wms.domain.bo; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.wms.domain.WmsInventoryCheck; + +/** + * 库存盘点业务对象 wms_inventory_check + * + * @author LionLi + * @date 2025-01-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = WmsInventoryCheck.class, reverseConvertGenerate = false) +public class WmsInventoryCheckBo extends BaseEntity { + + /** + * 表主键 + */ + + private Long inventoryCheckId; + + /** + * 盘点单号 + */ + + private String checkCode; + + /** + * 物料大类 + */ + + private String materialCategories; + + /** + * 计划仓库ID + */ + + private Long planWarehouseId; + + /** + * 盘点类型(1全部,2货架,3物料)) + */ + private String checkType; + + /** + * 盘点状态(0计划,2盘点中,3盘点完成) + */ + private String checkStatus; + + /** + * 审核人 + */ + private String auditBy; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + private String auditStatus; + + /** + * 审核意见 + */ + private String auditComments; + + /** + * 开始时间 + */ + private Date beginTime; + + /** + * 结束时间 + */ + private Date endTime; + private String tenantId; + + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsInventoryCheckRecordBo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsInventoryCheckRecordBo.java new file mode 100644 index 00000000..1146dc2d --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsInventoryCheckRecordBo.java @@ -0,0 +1,132 @@ +package org.dromara.wms.domain.bo; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.wms.domain.WmsInventoryCheckRecord; + +/** + * 盘点记录和调整工单业务对象 wms_inventory_check_record + * + * @author LionLi + * @date 2025-01-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = WmsInventoryCheckRecord.class, reverseConvertGenerate = false) +public class WmsInventoryCheckRecordBo extends BaseEntity { + + /** + * 盘点记录主键 + */ + private Long icRecordId; + + /** + * 物料大类 + */ + private String materialCategories; + + /** + * 盘点单号 + */ + private String checkCode; + + /** + * 批次码 + */ + private String batchCode; + + /** + * 物料id + */ + private Long materialId; + + /** + * 库位编码 + */ + private String locationCode; + + /** + * 物料编码 + */ + private String materialCode; + + /** + * 物料名称 + */ + private String materialName; + + /** + * 库存数量 + */ + private String inventoryQty; + + /** + * 盘点数量 + */ + private Long checkQty; + + /** + * 盘点状态(0异常,1正常) + */ + private String checkStatus; + + /** + * erp同步状态 + */ + private String erpSynchronousStatus; + + /** + * erp同步数量 + */ + private Long erpSynchronousQty; + + /** + * 是否发起调整(0否,1是) + */ + private String isAdjust; + + /** + * 审核人 + */ + + private String auditBy; + + /** + * 审核时间 + */ + + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + + private String auditStatus; + + /** + * 审核意见 + */ + + private String auditComments; + + /** + * 调整状态(0待执行,1完成) + */ + + private String adjustStatus; + + /** + * 调整类型(1库存调整) + */ + + private String adjustType; + private String tenantId; + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsMoveOrderBo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsMoveOrderBo.java new file mode 100644 index 00000000..bbb57748 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsMoveOrderBo.java @@ -0,0 +1,94 @@ +package org.dromara.wms.domain.bo; + +import org.dromara.common.mybatis.core.domain.BaseEntity; +import org.dromara.common.core.validate.AddGroup; +import org.dromara.common.core.validate.EditGroup; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import lombok.EqualsAndHashCode; +import jakarta.validation.constraints.*; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.wms.domain.WmsMoveOrder; + +/** + * 移库工单业务对象 wms_move_order + * + * @author LionLi + * @date 2025-01-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = WmsMoveOrder.class, reverseConvertGenerate = false) +public class WmsMoveOrderBo extends BaseEntity { + + /** + * 表主键 + */ + private Long moveId; + + /** + * 物料ID + */ + private Long materialId; + + /** + * 物料大类 + */ + private String materialCategories; + + /** + * 仓库ID + */ + private Long warehouseId; + + /** + * 计划库位 + */ + private String planLocationCode; + + /** + * 工单状态(0执行中,1完成,2关闭) + */ + private String orderStatus; + + /** + * 目标库位 + */ + private String targetLocationCode; + + /** + * 审核人 + */ + private String auditBy; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + private String auditStatus; + + /** + * 审核意见 + */ + private String auditComments; + + /** + * erp同步状态 + */ + private String erpSynchronousStatus; + + /** + * erp同步数量 + */ + private Long erpSynchronousQty; + private String tenantId; + private String warehouseCode; + private String materialCode; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsOutstockRecordBo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsOutstockRecordBo.java index ff945cf9..91b4a7fb 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsOutstockRecordBo.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsOutstockRecordBo.java @@ -1,5 +1,6 @@ package org.dromara.wms.domain.bo; +import com.ibm.icu.math.BigDecimal; import org.dromara.wms.domain.WmsOutstockRecord; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; @@ -53,7 +54,7 @@ public class WmsOutstockRecordBo extends BaseEntity { /** * 出库数量 */ - private Long outstockQty; + private java.math.BigDecimal outstockQty; /** * 物料大类 @@ -68,7 +69,9 @@ public class WmsOutstockRecordBo extends BaseEntity { /** * erp同步数量 */ - private Long erpSynchronousQty; + private java.math.BigDecimal erpSynchronousQty; + private java.math.BigDecimal returnQty; + private String returnFlag; } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsReturnOrderBo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsReturnOrderBo.java index 3bb0946b..11991a37 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsReturnOrderBo.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsReturnOrderBo.java @@ -1,5 +1,6 @@ package org.dromara.wms.domain.bo; +import com.baomidou.mybatisplus.annotation.TableField; import org.dromara.common.mybatis.core.domain.BaseEntity; import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.EditGroup; @@ -7,6 +8,8 @@ import io.github.linpeilie.annotations.AutoMapper; import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; + +import java.math.BigDecimal; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; import org.dromara.wms.domain.WmsReturnOrder; @@ -49,7 +52,7 @@ public class WmsReturnOrderBo extends BaseEntity{ * 计划数量 */ // @NotNull(message = "计划数量不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long planAmount; + private BigDecimal planAmount; /** * 仓库ID @@ -73,7 +76,7 @@ public class WmsReturnOrderBo extends BaseEntity{ * 实际数量 */ // @NotNull(message = "实际数量不能为空", groups = { AddGroup.class, EditGroup.class }) - private Long returnAmount; + private BigDecimal returnAmount; /** * 实际退库库位 @@ -117,6 +120,8 @@ public class WmsReturnOrderBo extends BaseEntity{ // @NotNull(message = "erp同步数量不能为空", groups = { AddGroup.class, EditGroup.class }) private Long erpSynchronousQty; private String tenantId; + private String materialCode; + } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryCheckRecordVo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryCheckRecordVo.java new file mode 100644 index 00000000..e5b7c1e9 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryCheckRecordVo.java @@ -0,0 +1,184 @@ +package org.dromara.wms.domain.vo; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.wms.domain.WmsInventoryCheckRecord; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 盘点记录和调整工单视图对象 wms_inventory_check_record + * + * @author LionLi + * @date 2025-01-10 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = WmsInventoryCheckRecord.class) +public class WmsInventoryCheckRecordVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 盘点记录主键 + */ + @ExcelProperty(value = "盘点记录主键") + private Long icRecordId; + + /** + * 物料大类 + */ + @ExcelProperty(value = "物料大类") + private String materialCategories; + + /** + * 盘点单号 + */ + @ExcelProperty(value = "盘点单号") + private String checkCode; + + /** + * 批次码 + */ + @ExcelProperty(value = "批次码") + private String batchCode; + + /** + * 物料id + */ + @ExcelProperty(value = "物料id") + private Long materialId; + + /** + * 库位编码 + */ + @ExcelProperty(value = "库位编码") + private String locationCode; + + /** + * 物料编码 + */ + @ExcelProperty(value = "物料编码") + private String materialCode; + + /** + * 物料名称 + */ + @ExcelProperty(value = "物料名称") + private String materialName; + + /** + * 库存数量 + */ + @ExcelProperty(value = "库存数量") + private String inventoryQty; + + /** + * 盘点数量 + */ + @ExcelProperty(value = "盘点数量") + private Long checkQty; + + /** + * 盘点状态(0异常,1正常) + */ + @ExcelProperty(value = "盘点状态(0异常,1正常)") + private String checkStatus; + + /** + * erp同步状态 + */ + @ExcelProperty(value = "erp同步状态") + private String erpSynchronousStatus; + + /** + * erp同步数量 + */ + @ExcelProperty(value = "erp同步数量") + private Long erpSynchronousQty; + + /** + * 是否发起调整(0否,1是) + */ + @ExcelProperty(value = "是否发起调整", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=否,1是") + private String isAdjust; + + /** + * 审核人 + */ + @ExcelProperty(value = "审核人") + private String auditBy; + + /** + * 审核时间 + */ + @ExcelProperty(value = "审核时间") + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + @ExcelProperty(value = "审核状态(0待审核,1审核通过,2审核未通过)") + private String auditStatus; + + /** + * 审核意见 + */ + @ExcelProperty(value = "审核意见") + private String auditComments; + + /** + * 调整状态(0待执行,1完成) + */ + @ExcelProperty(value = "调整状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=待执行,1完成") + private String adjustStatus; + + /** + * 调整类型(1库存调整) + */ + @ExcelProperty(value = "调整类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "1=库存调整") + private String adjustType; + /** + * 租户id + */ + private String tenantId; + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryCheckVo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryCheckVo.java new file mode 100644 index 00000000..a0e35762 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryCheckVo.java @@ -0,0 +1,135 @@ +package org.dromara.wms.domain.vo; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.wms.domain.WmsInventoryCheck; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 库存盘点视图对象 wms_inventory_check + * + * @author LionLi + * @date 2025-01-10 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = WmsInventoryCheck.class) +public class WmsInventoryCheckVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 表主键 + */ + @ExcelProperty(value = "表主键") + private Long inventoryCheckId; + + /** + * 盘点单号 + */ + @ExcelProperty(value = "盘点单号") + private String checkCode; + + /** + * 物料大类 + */ + @ExcelProperty(value = "物料大类") + private String materialCategories; + + /** + * 计划仓库ID + */ + @ExcelProperty(value = "计划仓库ID") + private Long planWarehouseId; + + /** + * 盘点类型(1全部,2货架,3物料)) + */ + @ExcelProperty(value = "盘点类型", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "1=全部,2货架,3物料") + private String checkType; + + /** + * 盘点状态(0计划,2盘点中,3盘点完成) + */ + @ExcelProperty(value = "盘点状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(readConverterExp = "0=计划,2盘点中,3盘点完成") + private String checkStatus; + + /** + * 审核人 + */ + @ExcelProperty(value = "审核人") + private String auditBy; + + /** + * 审核时间 + */ + @ExcelProperty(value = "审核时间") + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + @ExcelProperty(value = "审核状态(0待审核,1审核通过,2审核未通过)") + private String auditStatus; + + /** + * 审核意见 + */ + @ExcelProperty(value = "审核意见") + private String auditComments; + + /** + * 开始时间 + */ + @ExcelProperty(value = "开始时间") + private Date beginTime; + + /** + * 结束时间 + */ + @ExcelProperty(value = "结束时间") + private Date endTime; + /** + * 租户id + */ + private String tenantId; + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + + private String warehouseCode;//字段映射 +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryVo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryVo.java index 8abbeba0..4c52d62c 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryVo.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsInventoryVo.java @@ -112,6 +112,7 @@ public class WmsInventoryVo implements Serializable { private Date updateTime; private String warehouseCode;//字段映射 + private String materialCode;//字段映射 } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsMoveOrderVo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsMoveOrderVo.java new file mode 100644 index 00000000..15e95069 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsMoveOrderVo.java @@ -0,0 +1,142 @@ +package org.dromara.wms.domain.vo; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.FieldFill; +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.wms.domain.WmsMoveOrder; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + + +/** + * 移库工单视图对象 wms_move_order + * + * @author LionLi + * @date 2025-01-10 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = WmsMoveOrder.class) +public class WmsMoveOrderVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 表主键 + */ + @ExcelProperty(value = "表主键") + private Long moveId; + + /** + * 物料ID + */ + @ExcelProperty(value = "物料ID") + private Long materialId; + + /** + * 物料大类 + */ + @ExcelProperty(value = "物料大类") + private String materialCategories; + + /** + * 仓库ID + */ + @ExcelProperty(value = "仓库ID") + private Long warehouseId; + + /** + * 计划库位 + */ + @ExcelProperty(value = "计划库位") + private String planLocationCode; + + /** + * 工单状态(0执行中,1完成,2关闭) + */ + @ExcelProperty(value = "工单状态(0执行中,1完成,2关闭)") + private String orderStatus; + + /** + * 目标库位 + */ + @ExcelProperty(value = "目标库位") + private String targetLocationCode; + + /** + * 审核人 + */ + @ExcelProperty(value = "审核人") + private String auditBy; + + /** + * 审核时间 + */ + @ExcelProperty(value = "审核时间") + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + @ExcelProperty(value = "审核状态(0待审核,1审核通过,2审核未通过)") + private String auditStatus; + + /** + * 审核意见 + */ + @ExcelProperty(value = "审核意见") + private String auditComments; + + /** + * erp同步状态 + */ + @ExcelProperty(value = "erp同步状态") + private String erpSynchronousStatus; + + /** + * erp同步数量 + */ + @ExcelProperty(value = "erp同步数量") + private Long erpSynchronousQty; + /** + * 租户id + */ + private String tenantId; + @TableField(fill = FieldFill.INSERT) + private String createBy; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + /** + * 更新者 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private String updateBy; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.INSERT_UPDATE) + private Date updateTime; + @TableField(exist = false) + private String warehouseCode; + @TableField(exist = false) + private String materialCode; + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsOutstockRecordVo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsOutstockRecordVo.java index f25241e7..9075c6ec 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsOutstockRecordVo.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsOutstockRecordVo.java @@ -10,6 +10,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; @@ -68,7 +69,7 @@ public class WmsOutstockRecordVo implements Serializable { * 出库数量 */ @ExcelProperty(value = "出库数量") - private Long outstockQty; + private BigDecimal outstockQty; /** * 物料大类 @@ -100,7 +101,7 @@ public class WmsOutstockRecordVo implements Serializable { * erp同步数量 */ @ExcelProperty(value = "erp同步数量") - private Long erpSynchronousQty; + private BigDecimal erpSynchronousQty; /** * 物料信息 */ @@ -108,4 +109,5 @@ public class WmsOutstockRecordVo implements Serializable { private String materialName; private String materialUnit; private String materialSpec; + private String returnFlag; } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsReturnOrderVo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsReturnOrderVo.java index eed0f0dc..fa9e579a 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsReturnOrderVo.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsReturnOrderVo.java @@ -1,5 +1,6 @@ package org.dromara.wms.domain.vo; +import java.math.BigDecimal; import java.util.Date; import com.baomidou.mybatisplus.annotation.FieldFill; @@ -61,7 +62,7 @@ public class WmsReturnOrderVo implements Serializable { * 计划数量 */ @ExcelProperty(value = "计划数量") - private Long planAmount; + private BigDecimal planAmount; /** * 仓库ID @@ -85,7 +86,7 @@ public class WmsReturnOrderVo implements Serializable { * 实际数量 */ @ExcelProperty(value = "实际数量") - private Long returnAmount; + private BigDecimal returnAmount; /** * 实际退库库位 @@ -154,4 +155,7 @@ public class WmsReturnOrderVo implements Serializable { @TableField(fill = FieldFill.INSERT_UPDATE) private Date updateTime; private String warehouseCode;//字段映射 + + private String materialCode; + } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsInventoryCheckMapper.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsInventoryCheckMapper.java new file mode 100644 index 00000000..3bc4ad65 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsInventoryCheckMapper.java @@ -0,0 +1,15 @@ +package org.dromara.wms.mapper; + +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; +import org.dromara.wms.domain.WmsInventoryCheck; +import org.dromara.wms.domain.vo.WmsInventoryCheckVo; + +/** + * 库存盘点Mapper接口 + * + * @author LionLi + * @date 2025-01-10 + */ +public interface WmsInventoryCheckMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsInventoryCheckRecordMapper.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsInventoryCheckRecordMapper.java new file mode 100644 index 00000000..7ae6f709 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsInventoryCheckRecordMapper.java @@ -0,0 +1,15 @@ +package org.dromara.wms.mapper; + +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; +import org.dromara.wms.domain.WmsInventoryCheckRecord; +import org.dromara.wms.domain.vo.WmsInventoryCheckRecordVo; + +/** + * 盘点记录和调整工单Mapper接口 + * + * @author LionLi + * @date 2025-01-10 + */ +public interface WmsInventoryCheckRecordMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsMoveOrderMapper.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsMoveOrderMapper.java new file mode 100644 index 00000000..d1f1e4aa --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsMoveOrderMapper.java @@ -0,0 +1,15 @@ +package org.dromara.wms.mapper; + +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; +import org.dromara.wms.domain.WmsMoveOrder; +import org.dromara.wms.domain.vo.WmsMoveOrderVo; + +/** + * 移库工单Mapper接口 + * + * @author LionLi + * @date 2025-01-10 + */ +public interface WmsMoveOrderMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsBaseLocationService.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsBaseLocationService.java index 57d9218f..68fee423 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsBaseLocationService.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsBaseLocationService.java @@ -41,6 +41,7 @@ public interface IWmsBaseLocationService { * @return 库位基础信息列表 */ List queryList(WmsBaseLocationBo bo); + List queryVoList(WmsBaseLocationBo bo); /** * 新增库位基础信息 diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryCheckRecordService.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryCheckRecordService.java new file mode 100644 index 00000000..edfa2443 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryCheckRecordService.java @@ -0,0 +1,68 @@ +package org.dromara.wms.service; + +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.wms.domain.bo.WmsInventoryCheckRecordBo; +import org.dromara.wms.domain.vo.WmsInventoryCheckRecordVo; + +import java.util.Collection; +import java.util.List; + +/** + * 盘点记录和调整工单Service接口 + * + * @author LionLi + * @date 2025-01-10 + */ +public interface IWmsInventoryCheckRecordService { + + /** + * 查询盘点记录和调整工单 + * + * @param icRecordId 主键 + * @return 盘点记录和调整工单 + */ + WmsInventoryCheckRecordVo queryById(Long icRecordId); + + /** + * 分页查询盘点记录和调整工单列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 盘点记录和调整工单分页列表 + */ + TableDataInfo queryPageList(WmsInventoryCheckRecordBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的盘点记录和调整工单列表 + * + * @param bo 查询条件 + * @return 盘点记录和调整工单列表 + */ + List queryList(WmsInventoryCheckRecordBo bo); + + /** + * 新增盘点记录和调整工单 + * + * @param bo 盘点记录和调整工单 + * @return 是否新增成功 + */ + Boolean insertByBo(WmsInventoryCheckRecordBo bo); + + /** + * 修改盘点记录和调整工单 + * + * @param bo 盘点记录和调整工单 + * @return 是否修改成功 + */ + Boolean updateByBo(WmsInventoryCheckRecordBo bo); + + /** + * 校验并批量删除盘点记录和调整工单信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryCheckService.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryCheckService.java new file mode 100644 index 00000000..2f6834da --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryCheckService.java @@ -0,0 +1,68 @@ +package org.dromara.wms.service; + +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.wms.domain.bo.WmsInventoryCheckBo; +import org.dromara.wms.domain.vo.WmsInventoryCheckVo; + +import java.util.Collection; +import java.util.List; + +/** + * 库存盘点Service接口 + * + * @author LionLi + * @date 2025-01-10 + */ +public interface IWmsInventoryCheckService { + + /** + * 查询库存盘点 + * + * @param inventoryCheckId 主键 + * @return 库存盘点 + */ + WmsInventoryCheckVo queryById(Long inventoryCheckId); + + /** + * 分页查询库存盘点列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 库存盘点分页列表 + */ + TableDataInfo queryPageList(WmsInventoryCheckBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的库存盘点列表 + * + * @param bo 查询条件 + * @return 库存盘点列表 + */ + List queryList(WmsInventoryCheckBo bo); + + /** + * 新增库存盘点 + * + * @param bo 库存盘点 + * @return 是否新增成功 + */ + Boolean insertByBo(WmsInventoryCheckBo bo); + + /** + * 修改库存盘点 + * + * @param bo 库存盘点 + * @return 是否修改成功 + */ + Boolean updateByBo(WmsInventoryCheckBo bo); + + /** + * 校验并批量删除库存盘点信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryService.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryService.java index 62a4013a..b7bc75fc 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryService.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsInventoryService.java @@ -4,10 +4,13 @@ import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.wms.domain.WmsInventory; import org.dromara.wms.domain.bo.WmsInventoryBo; +import org.dromara.wms.domain.bo.WmsMoveOrderBo; import org.dromara.wms.domain.vo.WmsInventoryVo; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Collection; +import java.util.HashMap; import java.util.List; /** @@ -69,4 +72,11 @@ public interface IWmsInventoryService { Boolean deleteWithValidByIds(Collection ids, Boolean isValid); BigDecimal materailCount(WmsInventory materialId); + HashMap> selectInventorys(WmsMoveOrderBo bo); + + List getMaterialInfoList(WmsInventoryBo bo); + + int updateWmsInventorys(ArrayList updateList); + + int deletePlanList(ArrayList ids); } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsMoveOrderService.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsMoveOrderService.java new file mode 100644 index 00000000..e3c8df47 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsMoveOrderService.java @@ -0,0 +1,68 @@ +package org.dromara.wms.service; + +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import org.dromara.wms.domain.bo.WmsMoveOrderBo; +import org.dromara.wms.domain.vo.WmsMoveOrderVo; + +import java.util.Collection; +import java.util.List; + +/** + * 移库工单Service接口 + * + * @author LionLi + * @date 2025-01-10 + */ +public interface IWmsMoveOrderService { + + /** + * 查询移库工单 + * + * @param moveId 主键 + * @return 移库工单 + */ + WmsMoveOrderVo queryById(Long moveId); + + /** + * 分页查询移库工单列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 移库工单分页列表 + */ + TableDataInfo queryPageList(WmsMoveOrderBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的移库工单列表 + * + * @param bo 查询条件 + * @return 移库工单列表 + */ + List queryList(WmsMoveOrderBo bo); + + /** + * 新增移库工单 + * + * @param bo 移库工单 + * @return 是否新增成功 + */ + Boolean insertByBo(WmsMoveOrderBo bo); + + /** + * 修改移库工单 + * + * @param bo 移库工单 + * @return 是否修改成功 + */ + Boolean updateByBo(WmsMoveOrderBo bo); + + /** + * 校验并批量删除移库工单信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsBaseLocationServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsBaseLocationServiceImpl.java index 0cfbaa95..cecad89e 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsBaseLocationServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsBaseLocationServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.wms.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -69,6 +70,12 @@ public class WmsBaseLocationServiceImpl implements IWmsBaseLocationService { MPJLambdaWrapper lqw = buildQueryWrapper(bo); return baseMapper.selectVoList(lqw); } + @Override + public List queryVoList(WmsBaseLocationBo bo) { + LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); + lqw.eq(WmsBaseLocation::getWarehouseId,bo.getWarehouseId()); + return baseMapper.selectVoList(lqw); + } private MPJLambdaWrapper buildQueryWrapper(WmsBaseLocationBo bo) { Map params = bo.getParams(); diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInstockOrderServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInstockOrderServiceImpl.java index 2915c95f..72fa8d2b 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInstockOrderServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInstockOrderServiceImpl.java @@ -150,7 +150,6 @@ public class WmsInstockOrderServiceImpl implements IWmsInstockOrderService { } return flag; } - public String generateOrder(Integer value){ if (value.toString().length()<3){ String fixedLengthString = String.format("%03d", value); diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryCheckRecordServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryCheckRecordServiceImpl.java new file mode 100644 index 00000000..dd3632c7 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryCheckRecordServiceImpl.java @@ -0,0 +1,151 @@ +package org.dromara.wms.service.impl; + +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.wms.domain.WmsInventoryCheckRecord; +import org.dromara.wms.domain.bo.WmsInventoryCheckRecordBo; +import org.dromara.wms.domain.vo.WmsInventoryCheckRecordVo; +import org.dromara.wms.mapper.WmsInventoryCheckRecordMapper; +import org.dromara.wms.service.IWmsInventoryCheckRecordService; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 盘点记录和调整工单Service业务层处理 + * + * @author LionLi + * @date 2025-01-10 + */ +@RequiredArgsConstructor +@Service +public class WmsInventoryCheckRecordServiceImpl implements IWmsInventoryCheckRecordService { + + private final WmsInventoryCheckRecordMapper baseMapper; + + /** + * 查询盘点记录和调整工单 + * + * @param icRecordId 主键 + * @return 盘点记录和调整工单 + */ + @Override + public WmsInventoryCheckRecordVo queryById(Long icRecordId){ + return baseMapper.selectVoById(icRecordId); + } + + /** + * 分页查询盘点记录和调整工单列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 盘点记录和调整工单分页列表 + */ + @Override + public TableDataInfo queryPageList(WmsInventoryCheckRecordBo bo, PageQuery pageQuery) { + MPJLambdaWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的盘点记录和调整工单列表 + * + * @param bo 查询条件 + * @return 盘点记录和调整工单列表 + */ + @Override + public List queryList(WmsInventoryCheckRecordBo bo) { + MPJLambdaWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private MPJLambdaWrapper buildQueryWrapper(WmsInventoryCheckRecordBo bo) { + Map params = bo.getParams(); + MPJLambdaWrapper lqw = JoinWrappers.lambda(WmsInventoryCheckRecord.class) + .selectAll(WmsInventoryCheckRecord.class) + .eq(bo.getIcRecordId() != null, WmsInventoryCheckRecord::getIcRecordId, bo.getIcRecordId()) + .eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsInventoryCheckRecord::getMaterialCategories, bo.getMaterialCategories()) + .eq(StringUtils.isNotBlank(bo.getCheckCode()), WmsInventoryCheckRecord::getCheckCode, bo.getCheckCode()) + .eq(StringUtils.isNotBlank(bo.getBatchCode()), WmsInventoryCheckRecord::getBatchCode, bo.getBatchCode()) + .eq(bo.getMaterialId() != null, WmsInventoryCheckRecord::getMaterialId, bo.getMaterialId()) + .eq(StringUtils.isNotBlank(bo.getLocationCode()), WmsInventoryCheckRecord::getLocationCode, bo.getLocationCode()) + .eq(StringUtils.isNotBlank(bo.getMaterialCode()), WmsInventoryCheckRecord::getMaterialCode, bo.getMaterialCode()) + .like(StringUtils.isNotBlank(bo.getMaterialName()), WmsInventoryCheckRecord::getMaterialName, bo.getMaterialName()) + .eq(StringUtils.isNotBlank(bo.getInventoryQty()), WmsInventoryCheckRecord::getInventoryQty, bo.getInventoryQty()) + .eq(bo.getCheckQty() != null, WmsInventoryCheckRecord::getCheckQty, bo.getCheckQty()) + .eq(StringUtils.isNotBlank(bo.getCheckStatus()), WmsInventoryCheckRecord::getCheckStatus, bo.getCheckStatus()) + .eq(StringUtils.isNotBlank(bo.getErpSynchronousStatus()), WmsInventoryCheckRecord::getErpSynchronousStatus, bo.getErpSynchronousStatus()) + .eq(bo.getErpSynchronousQty() != null, WmsInventoryCheckRecord::getErpSynchronousQty, bo.getErpSynchronousQty()) + .eq(StringUtils.isNotBlank(bo.getIsAdjust()), WmsInventoryCheckRecord::getIsAdjust, bo.getIsAdjust()) + .eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsInventoryCheckRecord::getAuditBy, bo.getAuditBy()) + .eq(bo.getAuditTime() != null, WmsInventoryCheckRecord::getAuditTime, bo.getAuditTime()) + .eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsInventoryCheckRecord::getAuditStatus, bo.getAuditStatus()) + .eq(StringUtils.isNotBlank(bo.getAuditComments()), WmsInventoryCheckRecord::getAuditComments, bo.getAuditComments()) + .eq(StringUtils.isNotBlank(bo.getAdjustStatus()), WmsInventoryCheckRecord::getAdjustStatus, bo.getAdjustStatus()) + .eq(StringUtils.isNotBlank(bo.getAdjustType()), WmsInventoryCheckRecord::getAdjustType, bo.getAdjustType()) + .orderByDesc(WmsInventoryCheckRecord::getCreateTime); + return lqw; + } + + /** + * 新增盘点记录和调整工单 + * + * @param bo 盘点记录和调整工单 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(WmsInventoryCheckRecordBo bo) { + WmsInventoryCheckRecord add = MapstructUtils.convert(bo, WmsInventoryCheckRecord.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setIcRecordId(add.getIcRecordId()); + } + return flag; + } + + /** + * 修改盘点记录和调整工单 + * + * @param bo 盘点记录和调整工单 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(WmsInventoryCheckRecordBo bo) { + WmsInventoryCheckRecord update = MapstructUtils.convert(bo, WmsInventoryCheckRecord.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(WmsInventoryCheckRecord entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除盘点记录和调整工单信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryCheckServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryCheckServiceImpl.java new file mode 100644 index 00000000..9e80db67 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryCheckServiceImpl.java @@ -0,0 +1,198 @@ +package org.dromara.wms.service.impl; + +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.wms.domain.WmsBaseWarehouse; +import org.dromara.wms.domain.WmsInstockOrder; +import org.dromara.wms.domain.WmsInventoryCheck; +import org.dromara.wms.domain.bo.WmsInstockOrderBo; +import org.dromara.wms.domain.bo.WmsInventoryCheckBo; +import org.dromara.wms.domain.vo.WmsInventoryCheckVo; +import org.dromara.wms.mapper.WmsInventoryCheckMapper; +import org.dromara.wms.service.IWmsInventoryCheckService; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Collection; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * 库存盘点Service业务层处理 + * + * @author LionLi + * @date 2025-01-10 + */ +@RequiredArgsConstructor +@Service +public class WmsInventoryCheckServiceImpl implements IWmsInventoryCheckService { + + private final WmsInventoryCheckMapper baseMapper; + private static final AtomicInteger sequence = new AtomicInteger(999); + public static Integer nextSequence() { + return sequence.incrementAndGet(); + } + + /** + * 查询库存盘点 + * + * @param inventoryCheckId 主键 + * @return 库存盘点 + */ + @Override + public WmsInventoryCheckVo queryById(Long inventoryCheckId){ + return baseMapper.selectVoById(inventoryCheckId); + } + + /** + * 分页查询库存盘点列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 库存盘点分页列表 + */ + @Override + public TableDataInfo queryPageList(WmsInventoryCheckBo bo, PageQuery pageQuery) { +// MPJLambdaWrapper lqw = buildQueryWrapper(bo); + MPJLambdaWrapper lqw = buildJoinQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的库存盘点列表 + * + * @param bo 查询条件 + * @return 库存盘点列表 + */ + @Override + public List queryList(WmsInventoryCheckBo bo) { + MPJLambdaWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private MPJLambdaWrapper buildQueryWrapper(WmsInventoryCheckBo bo) { + Map params = bo.getParams(); + MPJLambdaWrapper lqw = JoinWrappers.lambda(WmsInventoryCheck.class) + .selectAll(WmsInventoryCheck.class) + .eq(bo.getInventoryCheckId() != null, WmsInventoryCheck::getInventoryCheckId, bo.getInventoryCheckId()) + .eq(StringUtils.isNotBlank(bo.getCheckCode()), WmsInventoryCheck::getCheckCode, bo.getCheckCode()) + .eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsInventoryCheck::getMaterialCategories, bo.getMaterialCategories()) + .eq(bo.getPlanWarehouseId() != null, WmsInventoryCheck::getPlanWarehouseId, bo.getPlanWarehouseId()) + .eq(StringUtils.isNotBlank(bo.getCheckType()), WmsInventoryCheck::getCheckType, bo.getCheckType()) + .eq(StringUtils.isNotBlank(bo.getCheckStatus()), WmsInventoryCheck::getCheckStatus, bo.getCheckStatus()) + .eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsInventoryCheck::getAuditBy, bo.getAuditBy()) + .eq(bo.getAuditTime() != null, WmsInventoryCheck::getAuditTime, bo.getAuditTime()) + .eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsInventoryCheck::getAuditStatus, bo.getAuditStatus()) + .eq(StringUtils.isNotBlank(bo.getAuditComments()), WmsInventoryCheck::getAuditComments, bo.getAuditComments()) + .eq(bo.getBeginTime() != null, WmsInventoryCheck::getBeginTime, bo.getBeginTime()) + .eq(bo.getEndTime() != null, WmsInventoryCheck::getEndTime, bo.getEndTime()) + .orderByDesc(WmsInventoryCheck::getCreateTime); + return lqw; + } + private MPJLambdaWrapper buildJoinQueryWrapper(WmsInventoryCheckBo bo) { + Map params = bo.getParams(); + MPJLambdaWrapper lqw = JoinWrappers.lambda(WmsInventoryCheck.class) + .selectAll(WmsInventoryCheck.class) + .select(WmsBaseWarehouse::getWarehouseCode) + .leftJoin(WmsBaseWarehouse.class, WmsBaseWarehouse::getWarehouseId, WmsInventoryCheck::getPlanWarehouseId); + lqw.eq(bo.getInventoryCheckId() != null, WmsInventoryCheck::getInventoryCheckId, bo.getInventoryCheckId()) + .eq(StringUtils.isNotBlank(bo.getCheckCode()), WmsInventoryCheck::getCheckCode, bo.getCheckCode()) + .eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsInventoryCheck::getMaterialCategories, bo.getMaterialCategories()) + .eq(bo.getPlanWarehouseId() != null, WmsInventoryCheck::getPlanWarehouseId, bo.getPlanWarehouseId()) + .eq(StringUtils.isNotBlank(bo.getCheckType()), WmsInventoryCheck::getCheckType, bo.getCheckType()) + .eq(StringUtils.isNotBlank(bo.getCheckStatus()), WmsInventoryCheck::getCheckStatus, bo.getCheckStatus()) + .eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsInventoryCheck::getAuditBy, bo.getAuditBy()) + .eq(bo.getAuditTime() != null, WmsInventoryCheck::getAuditTime, bo.getAuditTime()) + .eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsInventoryCheck::getAuditStatus, bo.getAuditStatus()) + .eq(StringUtils.isNotBlank(bo.getAuditComments()), WmsInventoryCheck::getAuditComments, bo.getAuditComments()) + .eq(bo.getBeginTime() != null, WmsInventoryCheck::getBeginTime, bo.getBeginTime()) + .eq(bo.getEndTime() != null, WmsInventoryCheck::getEndTime, bo.getEndTime()) + .orderByDesc(WmsInventoryCheck::getCreateTime); + return lqw; + } + + /** + * 新增库存盘点 + * + * @param bo 库存盘点 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(WmsInventoryCheckBo bo) { + Date date = new Date(); + SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHssmm"); + String orderDate = format.format(date).substring(2); + String order = "ST"; + String orderLast=""; + Integer value = nextSequence(); + if (value.toString().length()==4){ + sequence.set(1); + orderLast = generateOrder(sequence.get()); + }else { + orderLast = generateOrder(value); + } + String stockingOrder = order + orderDate + orderLast; + WmsInventoryCheck add = MapstructUtils.convert(bo, WmsInventoryCheck.class); + add.setCheckCode(stockingOrder); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setInventoryCheckId(add.getInventoryCheckId()); + } + return flag; + } + public String generateOrder(Integer value){ + if (value.toString().length()<3){ + String fixedLengthString = String.format("%03d", value); + return fixedLengthString; + }else if (value.toString().length()==3){ + return value.toString(); + } + return value.toString(); + } + + /** + * 修改库存盘点 + * + * @param bo 库存盘点 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(WmsInventoryCheckBo bo) { + WmsInventoryCheck update = MapstructUtils.convert(bo, WmsInventoryCheck.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(WmsInventoryCheck entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除库存盘点信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java index 67d8c7a0..c8591333 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryServiceImpl.java @@ -10,20 +10,20 @@ 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.dromara.wms.domain.BaseMaterialInfo; import org.dromara.wms.domain.WmsBaseWarehouse; import org.dromara.wms.domain.WmsConfiguration; import org.dromara.wms.domain.WmsInventory; import org.dromara.wms.domain.bo.WmsConfigurationBo; import org.dromara.wms.domain.bo.WmsInventoryBo; +import org.dromara.wms.domain.bo.WmsMoveOrderBo; import org.dromara.wms.domain.vo.WmsInventoryVo; import org.dromara.wms.mapper.WmsInventoryMapper; import org.dromara.wms.service.IWmsInventoryService; import org.springframework.stereotype.Service; import java.math.BigDecimal; -import java.util.List; -import java.util.Map; -import java.util.Collection; +import java.util.*; import java.util.stream.Collectors; /** @@ -146,6 +146,42 @@ public class WmsInventoryServiceImpl implements IWmsInventoryService { //TODO 做一些数据校验,如唯一约束 } + @Override + public int updateWmsInventorys(ArrayList updateList) { + return baseMapper.updateById(updateList).size(); + + } + + @Override + public int deletePlanList(ArrayList ids) { + return baseMapper.deleteByIds(ids); + } + + @Override + public List getMaterialInfoList(WmsInventoryBo bo) { + MPJLambdaWrapper lqw = new MPJLambdaWrapper<>(); + lqw.selectAll(WmsInventory.class).select(BaseMaterialInfo::getMaterialCode) + .leftJoin(BaseMaterialInfo.class,BaseMaterialInfo::getMaterialId,WmsInventory::getMaterialId); + lqw.eq(WmsInventory::getLocationCode,bo.getLocationCode()); + return baseMapper.selectVoList(lqw); + } + + @Override + public HashMap> selectInventorys(WmsMoveOrderBo bo) { + LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); + lqw.eq(WmsInventory::getLocationCode,bo.getPlanLocationCode()) + .eq(WmsInventory::getMaterialId,bo.getMaterialId()); + List planList = baseMapper.selectVoList(lqw); + LambdaQueryWrapper lqw1 = new LambdaQueryWrapper<>(); + lqw1.eq(WmsInventory::getLocationCode,bo.getTargetLocationCode()) + .eq(WmsInventory::getMaterialId,bo.getMaterialId()); + List targetList = baseMapper.selectVoList(lqw1); + HashMap> result = new HashMap<>(); + result.put("planList",planList); + result.put("targetList",targetList); + return result; + } + @Override public BigDecimal materailCount(WmsInventory wmsInventory) { return baseMapper.materailCount(wmsInventory); diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsMoveOrderServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsMoveOrderServiceImpl.java new file mode 100644 index 00000000..73488fd4 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsMoveOrderServiceImpl.java @@ -0,0 +1,185 @@ +package org.dromara.wms.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.dromara.wms.domain.BaseMaterialInfo; +import org.dromara.wms.domain.WmsBaseWarehouse; +import org.dromara.wms.domain.WmsInventory; +import org.dromara.wms.domain.WmsMoveOrder; +import org.dromara.wms.domain.bo.WmsInventoryBo; +import org.dromara.wms.domain.bo.WmsMoveOrderBo; +import org.dromara.wms.domain.vo.WmsInventoryVo; +import org.dromara.wms.domain.vo.WmsMoveOrderVo; +import org.dromara.wms.mapper.WmsMoveOrderMapper; +import org.dromara.wms.service.IWmsInventoryService; +import org.dromara.wms.service.IWmsMoveOrderService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 移库工单Service业务层处理 + * + * @author LionLi + * @date 2025-01-10 + */ +@RequiredArgsConstructor +@Service +public class WmsMoveOrderServiceImpl implements IWmsMoveOrderService { + + private final WmsMoveOrderMapper baseMapper; + @Autowired + private IWmsInventoryService wmsInventoryService; + + /** + * 查询移库工单 + * + * @param moveId 主键 + * @return 移库工单 + */ + @Override + public WmsMoveOrderVo queryById(Long moveId){ + return baseMapper.selectVoById(moveId); + } + + /** + * 分页查询移库工单列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 移库工单分页列表 + */ + @Override + public TableDataInfo queryPageList(WmsMoveOrderBo bo, PageQuery pageQuery) { + MPJLambdaWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的移库工单列表 + * + * @param bo 查询条件 + * @return 移库工单列表 + */ + @Override + public List queryList(WmsMoveOrderBo bo) { + MPJLambdaWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private MPJLambdaWrapper buildQueryWrapper(WmsMoveOrderBo bo) { + Map params = bo.getParams(); + MPJLambdaWrapper lqw = JoinWrappers.lambda(WmsMoveOrder.class) + .selectAll(WmsMoveOrder.class).select(WmsBaseWarehouse::getWarehouseCode).select(BaseMaterialInfo::getMaterialCode) + .leftJoin(WmsBaseWarehouse.class,WmsBaseWarehouse::getWarehouseId,WmsMoveOrder::getWarehouseId) + .leftJoin(BaseMaterialInfo.class,BaseMaterialInfo::getMaterialId,WmsMoveOrder::getMaterialId) + .eq(bo.getMoveId() != null, WmsMoveOrder::getMoveId, bo.getMoveId()) + .eq(bo.getMaterialId() != null, WmsMoveOrder::getMaterialId, bo.getMaterialId()) + .eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsMoveOrder::getMaterialCategories, bo.getMaterialCategories()) + .eq(bo.getWarehouseId() != null, WmsMoveOrder::getWarehouseId, bo.getWarehouseId()) + .eq(bo.getPlanLocationCode() != null, WmsMoveOrder::getPlanLocationCode, bo.getPlanLocationCode()) + .eq(StringUtils.isNotBlank(bo.getOrderStatus()), WmsMoveOrder::getOrderStatus, bo.getOrderStatus()) + .eq(bo.getTargetLocationCode() != null, WmsMoveOrder::getTargetLocationCode, bo.getTargetLocationCode()) + .eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsMoveOrder::getAuditBy, bo.getAuditBy()) + .eq(bo.getAuditTime() != null, WmsMoveOrder::getAuditTime, bo.getAuditTime()) + .eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsMoveOrder::getAuditStatus, bo.getAuditStatus()) + .eq(StringUtils.isNotBlank(bo.getAuditComments()), WmsMoveOrder::getAuditComments, bo.getAuditComments()) + .eq(StringUtils.isNotBlank(bo.getErpSynchronousStatus()), WmsMoveOrder::getErpSynchronousStatus, bo.getErpSynchronousStatus()) + .eq(bo.getErpSynchronousQty() != null, WmsMoveOrder::getErpSynchronousQty, bo.getErpSynchronousQty()) + .orderByDesc(WmsMoveOrder::getCreateTime); + return lqw; + } + + /** + * 新增移库工单 + * + * @param bo 移库工单 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(WmsMoveOrderBo bo) { + //查询仓库现有的物料数量 + HashMap> list = wmsInventoryService.selectInventorys(bo); + List planList = list.get("planList");//计划库位数据 + if (CollectionUtils.isEmpty(planList)){ + return false; + } + ArrayList updateList = new ArrayList<>(); + ArrayList ids = new ArrayList<>(); + List targetList = list.get("targetList");//目标库位数据 + Map> resultList = targetList.stream().collect(Collectors.groupingBy(WmsInventoryVo::getBatchCode)); + for (WmsInventoryVo vo : planList) { + WmsInventory wmsInventory = new WmsInventory(); + if (CollectionUtils.isEmpty(resultList.get(vo.getBatchCode()))){ + vo.setLocationCode(bo.getTargetLocationCode()); + BeanUtils.copyProperties(vo,wmsInventory); + updateList.add(wmsInventory); + }else { + WmsInventoryVo target = resultList.get(vo.getBatchCode()).get(0); + BigDecimal add = target.getInventoryQty().add(vo.getInventoryQty()); + target.setInventoryQty(add); + BeanUtils.copyProperties(target,wmsInventory); + updateList.add(wmsInventory); + ids.add(vo.getInventoryId()); + } + } + int removeRows = wmsInventoryService.deletePlanList(ids); + int rows = wmsInventoryService.updateWmsInventorys(updateList); + WmsMoveOrder add = MapstructUtils.convert(bo, WmsMoveOrder.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setMoveId(add.getMoveId()); + } + return flag; + } + + /** + * 修改移库工单 + * + * @param bo 移库工单 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(WmsMoveOrderBo bo) { + WmsMoveOrder update = MapstructUtils.convert(bo, WmsMoveOrder.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(WmsMoveOrder entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除移库工单信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockRecordServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockRecordServiceImpl.java index 235c0b4d..02029e1e 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockRecordServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockRecordServiceImpl.java @@ -10,6 +10,11 @@ import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; import org.dromara.wms.domain.BaseMaterialInfo; +import org.dromara.wms.domain.WmsReturnOrder; +import org.dromara.wms.domain.bo.WmsReturnOrderBo; +import org.dromara.wms.service.IWmsReturnOrderService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.dromara.wms.domain.bo.WmsOutstockRecordBo; import org.dromara.wms.domain.vo.WmsOutstockRecordVo; @@ -17,6 +22,7 @@ import org.dromara.wms.domain.WmsOutstockRecord; import org.dromara.wms.mapper.WmsOutstockRecordMapper; import org.dromara.wms.service.IWmsOutstockRecordService; +import java.math.BigDecimal; import java.util.List; import java.util.Map; import java.util.Collection; @@ -32,6 +38,10 @@ import java.util.Collection; public class WmsOutstockRecordServiceImpl implements IWmsOutstockRecordService { private final WmsOutstockRecordMapper baseMapper; + @Autowired + private IWmsReturnOrderService wmsReturnOrderService; + + private static String NO_RETURN = "1"; //禁用回退 /** * 查询出库记录 @@ -109,9 +119,22 @@ public class WmsOutstockRecordServiceImpl implements IWmsOutstockRecordService { */ @Override public Boolean updateByBo(WmsOutstockRecordBo bo) { - WmsOutstockRecord update = MapstructUtils.convert(bo, WmsOutstockRecord.class); - validEntityBeforeSave(update); - return baseMapper.updateById(update) > 0; + if (bo.getReturnQty()==null){ + WmsOutstockRecord update = MapstructUtils.convert(bo, WmsOutstockRecord.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + if (bo.getReturnQty().compareTo(bo.getOutstockQty())>0){ + return false; + } + if (bo.getReturnFlag().equals(NO_RETURN)){ + return false; + } + WmsReturnOrderBo wmsReturnOrder = new WmsReturnOrderBo(); + BeanUtils.copyProperties(bo,wmsReturnOrder); + wmsReturnOrder.setPlanAmount(bo.getReturnQty()); + return wmsReturnOrderService.insertByBo(wmsReturnOrder); + } /** diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsReturnOrderServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsReturnOrderServiceImpl.java index 0a76dd18..fecc37f5 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsReturnOrderServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsReturnOrderServiceImpl.java @@ -1,5 +1,7 @@ package org.dromara.wms.service.impl; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -8,7 +10,11 @@ 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.dromara.wms.domain.BaseMaterialInfo; +import org.dromara.wms.domain.WmsBaseWarehouse; +import org.dromara.wms.domain.WmsOutstockRecord; import org.dromara.wms.domain.WmsReturnOrder; +import org.dromara.wms.domain.bo.WmsOutstockRecordBo; import org.dromara.wms.domain.bo.WmsReturnOrderBo; import org.dromara.wms.domain.vo.WmsReturnOrderVo; import org.dromara.wms.mapper.WmsReturnOrderMapper; @@ -51,8 +57,9 @@ public class WmsReturnOrderServiceImpl implements IWmsReturnOrderService { */ @Override public TableDataInfo queryPageList(WmsReturnOrderBo bo, PageQuery pageQuery) { - LambdaQueryWrapper lqw = buildQueryWrapper(bo); - lqw.orderByDesc(WmsReturnOrder::getCreateTime); +// LambdaQueryWrapper lqw = buildQueryWrapper(bo); + MPJLambdaWrapper lqw = buildJoinQueryWrapper(bo); +// lqw.orderByDesc(WmsReturnOrder::getCreateTime); Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); return TableDataInfo.build(result); } @@ -68,7 +75,33 @@ public class WmsReturnOrderServiceImpl implements IWmsReturnOrderService { LambdaQueryWrapper lqw = buildQueryWrapper(bo); return baseMapper.selectVoList(lqw); } - + private MPJLambdaWrapper buildJoinQueryWrapper(WmsReturnOrderBo bo) { + Map params = bo.getParams(); + MPJLambdaWrapper lqw = JoinWrappers.lambda(WmsReturnOrder.class) + .selectAll(WmsReturnOrder.class) + .select(BaseMaterialInfo::getMaterialCode) + .select(WmsBaseWarehouse::getWarehouseCode) + .leftJoin(BaseMaterialInfo.class,BaseMaterialInfo::getMaterialId,WmsReturnOrder::getMaterialId) + .leftJoin(WmsBaseWarehouse.class,WmsBaseWarehouse::getWarehouseId,WmsReturnOrder::getWarehouseId); + lqw.eq(bo.getRoId() != null, WmsReturnOrder::getRoId, bo.getRoId()); + lqw.eq(bo.getMaterialId() != null, WmsReturnOrder::getMaterialId, bo.getMaterialId()); + lqw.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsReturnOrder::getMaterialCategories, bo.getMaterialCategories()); + lqw.eq(StringUtils.isNotBlank(bo.getBatchCode()), WmsReturnOrder::getBatchCode, bo.getBatchCode()); + lqw.eq(bo.getPlanAmount() != null, WmsReturnOrder::getPlanAmount, bo.getPlanAmount()); + lqw.eq(bo.getWarehouseId() != null, WmsReturnOrder::getWarehouseId, bo.getWarehouseId()); + lqw.eq(StringUtils.isNotBlank(bo.getPlanLocationCode()), WmsReturnOrder::getPlanLocationCode, bo.getPlanLocationCode()); + lqw.eq(StringUtils.isNotBlank(bo.getOrderStatus()), WmsReturnOrder::getOrderStatus, bo.getOrderStatus()); + lqw.eq(bo.getReturnAmount() != null, WmsReturnOrder::getReturnAmount, bo.getReturnAmount()); + lqw.eq(StringUtils.isNotBlank(bo.getReturnLocationCode()), WmsReturnOrder::getReturnLocationCode, bo.getReturnLocationCode()); + lqw.eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsReturnOrder::getAuditBy, bo.getAuditBy()); + lqw.eq(bo.getAuditTime() != null, WmsReturnOrder::getAuditTime, bo.getAuditTime()); + lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsReturnOrder::getAuditStatus, bo.getAuditStatus()); + lqw.eq(StringUtils.isNotBlank(bo.getAuditComments()), WmsReturnOrder::getAuditComments, bo.getAuditComments()); + lqw.eq(StringUtils.isNotBlank(bo.getErpSynchronousStatus()), WmsReturnOrder::getErpSynchronousStatus, bo.getErpSynchronousStatus()); + lqw.eq(bo.getErpSynchronousQty() != null, WmsReturnOrder::getErpSynchronousQty, bo.getErpSynchronousQty()); + lqw.orderByDesc(WmsReturnOrder::getCreateTime); + return lqw; + } private LambdaQueryWrapper buildQueryWrapper(WmsReturnOrderBo bo) { Map params = bo.getParams(); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); diff --git a/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsInventoryCheckMapper.xml b/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsInventoryCheckMapper.xml new file mode 100644 index 00000000..f92133ce --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsInventoryCheckMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsMoveOrderMapper.xml b/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsMoveOrderMapper.xml new file mode 100644 index 00000000..5264b408 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsMoveOrderMapper.xml @@ -0,0 +1,7 @@ + + + + +