新增物料盘点和移库单

master
maxw@mesnac.com 7 days ago
parent cd18e05358
commit b3bc122741

@ -114,4 +114,10 @@ public class WmsBaseLocationController extends BaseController {
List<WmsBaseLocationVo> list = wmsBaseLocationService.queryList(bo);
return R.ok(list);
}
@GetMapping("getWmsBaseLocationVoList")
public R<List<WmsBaseLocationVo>> getWmsBaseLocationVoList(WmsBaseLocationBo bo) {
List<WmsBaseLocationVo> list = wmsBaseLocationService.queryVoList(bo);
return R.ok(list);
}
}

@ -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<WmsInventoryCheckVo> 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<WmsInventoryCheckVo> list = wmsInventoryCheckService.queryList(bo);
ExcelUtil.exportExcel(list, "库存盘点", WmsInventoryCheckVo.class, response);
}
/**
*
*
* @param inventoryCheckId
*/
@SaCheckPermission("system:inventoryCheck:query")
@GetMapping("/{inventoryCheckId}")
public R<WmsInventoryCheckVo> 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<Void> add(@RequestBody WmsInventoryCheckBo bo) {
return toAjax(wmsInventoryCheckService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("system:inventoryCheck:edit")
@Log(title = "库存盘点", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] inventoryCheckIds) {
return toAjax(wmsInventoryCheckService.deleteWithValidByIds(List.of(inventoryCheckIds), true));
}
/**
*
*/
@GetMapping("getWmsInventoryCheckList")
public R<List<WmsInventoryCheckVo>> getWmsInventoryChecklist(WmsInventoryCheckBo bo) {
List<WmsInventoryCheckVo> list = wmsInventoryCheckService.queryList(bo);
return R.ok(list);
}
}

@ -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<WmsInventoryCheckRecordVo> 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<WmsInventoryCheckRecordVo> list = wmsInventoryCheckRecordService.queryList(bo);
ExcelUtil.exportExcel(list, "盘点记录和调整工单", WmsInventoryCheckRecordVo.class, response);
}
/**
*
*
* @param icRecordId
*/
@SaCheckPermission("system:inventoryCheckRecord:query")
@GetMapping("/{icRecordId}")
public R<WmsInventoryCheckRecordVo> 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<Void> 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<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] icRecordIds) {
return toAjax(wmsInventoryCheckRecordService.deleteWithValidByIds(List.of(icRecordIds), true));
}
/**
*
*/
@GetMapping("getWmsInventoryCheckRecordList")
public R<List<WmsInventoryCheckRecordVo>> getWmsInventoryCheckRecordlist(WmsInventoryCheckRecordBo bo) {
List<WmsInventoryCheckRecordVo> list = wmsInventoryCheckRecordService.queryList(bo);
return R.ok(list);
}
}

@ -113,4 +113,9 @@ public class WmsInventoryController extends BaseController {
BigDecimal bigDecimal = wmsInventoryService.materailCount(materialId);
return R.ok(wmsInventoryService.materailCount(materialId));
}
@GetMapping("/getMaterialInfoList")
public R<List<WmsInventoryVo>> getMaterialInfoList(WmsInventoryBo bo) {
return R.ok(wmsInventoryService.getMaterialInfoList(bo));
}
}

@ -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<WmsMoveOrderVo> 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<WmsMoveOrderVo> list = wmsMoveOrderService.queryList(bo);
ExcelUtil.exportExcel(list, "移库工单", WmsMoveOrderVo.class, response);
}
/**
*
*
* @param moveId
*/
@SaCheckPermission("system:moveOrder:query")
@GetMapping("/{moveId}")
public R<WmsMoveOrderVo> 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<Void> 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<Void> 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<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] moveIds) {
return toAjax(wmsMoveOrderService.deleteWithValidByIds(List.of(moveIds), true));
}
/**
*
*/
@GetMapping("getWmsMoveOrderList")
public R<List<WmsMoveOrderVo>> getWmsMoveOrderlist(WmsMoveOrderBo bo) {
List<WmsMoveOrderVo> list = wmsMoveOrderService.queryList(bo);
return R.ok(list);
}
}

@ -87,7 +87,7 @@ public class WmsOutstockRecordController extends BaseController {
@Log(title = "出库记录", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsOutstockRecordBo bo) {
public R<Void> edit(@RequestBody WmsOutstockRecordBo bo) {
return toAjax(wmsOutstockRecordService.updateByBo(bo));
}

@ -93,6 +93,8 @@ public class WmsInventory{
private Date updateTime;
@TableField(exist = false)
private String warehouseCode;//字段映射
@TableField(exist = false)
private String materialCode;//字段映射
}

@ -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;
/**
* 123
*/
private String checkType;
/**
* 023
*/
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;//字段映射
}

@ -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;
/**
* (01)
*/
private String checkStatus;
/**
* erp
*/
private String erpSynchronousStatus;
/**
* erp
*/
private Long erpSynchronousQty;
/**
* 01
*/
private String isAdjust;
/**
*
*/
private String auditBy;
/**
*
*/
private Date auditTime;
/**
* (0,1,2)
*/
private String auditStatus;
/**
*
*/
private String auditComments;
/**
* 01
*/
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;
}

@ -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;
/**
* (012)
*/
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;
}

@ -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;
}

@ -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;
}

@ -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;
/**
* 123
*/
private String checkType;
/**
* 023
*/
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;
}

@ -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;
/**
* (01)
*/
private String checkStatus;
/**
* erp
*/
private String erpSynchronousStatus;
/**
* erp
*/
private Long erpSynchronousQty;
/**
* 01
*/
private String isAdjust;
/**
*
*/
private String auditBy;
/**
*
*/
private Date auditTime;
/**
* (0,1,2)
*/
private String auditStatus;
/**
*
*/
private String auditComments;
/**
* 01
*/
private String adjustStatus;
/**
* 1
*/
private String adjustType;
private String tenantId;
}

@ -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;
/**
* (012)
*/
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;
}

@ -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;
}

@ -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;
}

@ -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;
/**
* (01)
*/
@ExcelProperty(value = "盘点状态(0异常1正常)")
private String checkStatus;
/**
* erp
*/
@ExcelProperty(value = "erp同步状态")
private String erpSynchronousStatus;
/**
* erp
*/
@ExcelProperty(value = "erp同步数量")
private Long erpSynchronousQty;
/**
* 01
*/
@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;
/**
* 01
*/
@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;
}

@ -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;
/**
* 123
*/
@ExcelProperty(value = "盘点类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "1=全部2货架3物料")
private String checkType;
/**
* 023
*/
@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;//字段映射
}

@ -112,6 +112,7 @@ public class WmsInventoryVo implements Serializable {
private Date updateTime;
private String warehouseCode;//字段映射
private String materialCode;//字段映射
}

@ -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;
/**
* (012)
*/
@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;
}

@ -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;
}

@ -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;
}

@ -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<WmsInventoryCheck, WmsInventoryCheckVo> {
}

@ -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<WmsInventoryCheckRecord, WmsInventoryCheckRecordVo> {
}

@ -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<WmsMoveOrder, WmsMoveOrderVo> {
}

@ -41,6 +41,7 @@ public interface IWmsBaseLocationService {
* @return
*/
List<WmsBaseLocationVo> queryList(WmsBaseLocationBo bo);
List<WmsBaseLocationVo> queryVoList(WmsBaseLocationBo bo);
/**
*

@ -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<WmsInventoryCheckRecordVo> queryPageList(WmsInventoryCheckRecordBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsInventoryCheckRecordVo> 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<Long> ids, Boolean isValid);
}

@ -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<WmsInventoryCheckVo> queryPageList(WmsInventoryCheckBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsInventoryCheckVo> 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<Long> ids, Boolean isValid);
}

@ -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<Long> ids, Boolean isValid);
BigDecimal materailCount(WmsInventory materialId);
HashMap<String, List<WmsInventoryVo>> selectInventorys(WmsMoveOrderBo bo);
List<WmsInventoryVo> getMaterialInfoList(WmsInventoryBo bo);
int updateWmsInventorys(ArrayList<WmsInventory> updateList);
int deletePlanList(ArrayList<Long> ids);
}

@ -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<WmsMoveOrderVo> queryPageList(WmsMoveOrderBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsMoveOrderVo> 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<Long> ids, Boolean isValid);
}

@ -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<WmsBaseLocation> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
@Override
public List<WmsBaseLocationVo> queryVoList(WmsBaseLocationBo bo) {
LambdaQueryWrapper<WmsBaseLocation> lqw = new LambdaQueryWrapper<>();
lqw.eq(WmsBaseLocation::getWarehouseId,bo.getWarehouseId());
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsBaseLocation> buildQueryWrapper(WmsBaseLocationBo bo) {
Map<String, Object> params = bo.getParams();

@ -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);

@ -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<WmsInventoryCheckRecordVo> queryPageList(WmsInventoryCheckRecordBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<WmsInventoryCheckRecord> lqw = buildQueryWrapper(bo);
Page<WmsInventoryCheckRecordVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsInventoryCheckRecordVo> queryList(WmsInventoryCheckRecordBo bo) {
MPJLambdaWrapper<WmsInventoryCheckRecord> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsInventoryCheckRecord> buildQueryWrapper(WmsInventoryCheckRecordBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsInventoryCheckRecord> 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<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -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<WmsInventoryCheckVo> queryPageList(WmsInventoryCheckBo bo, PageQuery pageQuery) {
// MPJLambdaWrapper<WmsInventoryCheck> lqw = buildQueryWrapper(bo);
MPJLambdaWrapper<WmsInventoryCheck> lqw = buildJoinQueryWrapper(bo);
Page<WmsInventoryCheckVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsInventoryCheckVo> queryList(WmsInventoryCheckBo bo) {
MPJLambdaWrapper<WmsInventoryCheck> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsInventoryCheck> buildQueryWrapper(WmsInventoryCheckBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsInventoryCheck> 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<WmsInventoryCheck> buildJoinQueryWrapper(WmsInventoryCheckBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsInventoryCheck> 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<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -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<WmsInventory> updateList) {
return baseMapper.updateById(updateList).size();
}
@Override
public int deletePlanList(ArrayList<Long> ids) {
return baseMapper.deleteByIds(ids);
}
@Override
public List<WmsInventoryVo> getMaterialInfoList(WmsInventoryBo bo) {
MPJLambdaWrapper<WmsInventory> 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<String, List<WmsInventoryVo>> selectInventorys(WmsMoveOrderBo bo) {
LambdaQueryWrapper<WmsInventory> lqw = new LambdaQueryWrapper<>();
lqw.eq(WmsInventory::getLocationCode,bo.getPlanLocationCode())
.eq(WmsInventory::getMaterialId,bo.getMaterialId());
List<WmsInventoryVo> planList = baseMapper.selectVoList(lqw);
LambdaQueryWrapper<WmsInventory> lqw1 = new LambdaQueryWrapper<>();
lqw1.eq(WmsInventory::getLocationCode,bo.getTargetLocationCode())
.eq(WmsInventory::getMaterialId,bo.getMaterialId());
List<WmsInventoryVo> targetList = baseMapper.selectVoList(lqw1);
HashMap<String, List<WmsInventoryVo>> result = new HashMap<>();
result.put("planList",planList);
result.put("targetList",targetList);
return result;
}
@Override
public BigDecimal materailCount(WmsInventory wmsInventory) {
return baseMapper.materailCount(wmsInventory);

@ -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<WmsMoveOrderVo> queryPageList(WmsMoveOrderBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<WmsMoveOrder> lqw = buildQueryWrapper(bo);
Page<WmsMoveOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsMoveOrderVo> queryList(WmsMoveOrderBo bo) {
MPJLambdaWrapper<WmsMoveOrder> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsMoveOrder> buildQueryWrapper(WmsMoveOrderBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsMoveOrder> 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<String, List<WmsInventoryVo>> list = wmsInventoryService.selectInventorys(bo);
List<WmsInventoryVo> planList = list.get("planList");//计划库位数据
if (CollectionUtils.isEmpty(planList)){
return false;
}
ArrayList<WmsInventory> updateList = new ArrayList<>();
ArrayList<Long> ids = new ArrayList<>();
List<WmsInventoryVo> targetList = list.get("targetList");//目标库位数据
Map<String, List<WmsInventoryVo>> 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<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -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);
}
/**

@ -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<WmsReturnOrderVo> queryPageList(WmsReturnOrderBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<WmsReturnOrder> lqw = buildQueryWrapper(bo);
lqw.orderByDesc(WmsReturnOrder::getCreateTime);
// LambdaQueryWrapper<WmsReturnOrder> lqw = buildQueryWrapper(bo);
MPJLambdaWrapper<WmsReturnOrder> lqw = buildJoinQueryWrapper(bo);
// lqw.orderByDesc(WmsReturnOrder::getCreateTime);
Page<WmsReturnOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
@ -68,7 +75,33 @@ public class WmsReturnOrderServiceImpl implements IWmsReturnOrderService {
LambdaQueryWrapper<WmsReturnOrder> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsReturnOrder> buildJoinQueryWrapper(WmsReturnOrderBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsReturnOrder> 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<WmsReturnOrder> buildQueryWrapper(WmsReturnOrderBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsReturnOrder> lqw = Wrappers.lambdaQuery();

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.wms.mapper.WmsInventoryCheckMapper">
</mapper>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.wms.mapper.WmsMoveOrderMapper">
</mapper>
Loading…
Cancel
Save