Merge remote-tracking branch 'origin/master'

master
wanghao 3 months ago
commit 5fb4dc48bf

@ -0,0 +1,107 @@
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.WmsInstockDetailBo;
import org.dromara.wms.domain.vo.WmsInstockDetailVo;
import org.dromara.wms.service.IWmsInstockDetailService;
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/instockDetail
*
* @author LionLi
* @date 2025-01-06
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/instockDetail")
public class WmsInstockDetailController extends BaseController {
private final IWmsInstockDetailService wmsInstockDetailService;
/**
* -
*/
@SaCheckPermission("system:instockDetail:list")
@GetMapping("/list")
public TableDataInfo<WmsInstockDetailVo> list(WmsInstockDetailBo bo, PageQuery pageQuery) {
return wmsInstockDetailService.queryPageList(bo, pageQuery);
}
/**
* -
*/
@SaCheckPermission("system:instockDetail:export")
@Log(title = "入库单-物料", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsInstockDetailBo bo, HttpServletResponse response) {
List<WmsInstockDetailVo> list = wmsInstockDetailService.queryList(bo);
ExcelUtil.exportExcel(list, "入库单-物料", WmsInstockDetailVo.class, response);
}
/**
* -
*
* @param instockDetailId
*/
@SaCheckPermission("system:instockDetail:query")
@GetMapping("/{instockDetailId}")
public R<WmsInstockDetailVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long instockDetailId) {
return R.ok(wmsInstockDetailService.queryById(instockDetailId));
}
/**
* -
*/
@SaCheckPermission("system:instockDetail:add")
@Log(title = "入库单-物料", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@RequestBody WmsInstockDetailBo bo) {
return toAjax(wmsInstockDetailService.insertByBo(bo));
}
/**
* -
*/
@SaCheckPermission("system:instockDetail:edit")
@Log(title = "入库单-物料", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@RequestBody WmsInstockDetailBo bo) {
return toAjax(wmsInstockDetailService.updateByBo(bo));
}
/**
* -
*
* @param instockDetailIds
*/
@SaCheckPermission("system:instockDetail:remove")
@Log(title = "入库单-物料", businessType = BusinessType.DELETE)
@DeleteMapping("/{instockDetailIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] instockDetailIds) {
return toAjax(wmsInstockDetailService.deleteWithValidByIds(List.of(instockDetailIds), true));
}
}

@ -0,0 +1,107 @@
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.WmsInstockOrderBo;
import org.dromara.wms.domain.vo.WmsInstockOrderVo;
import org.dromara.wms.service.IWmsInstockOrderService;
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/instockOrder
*
* @author LionLi
* @date 2025-01-06
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/instockOrder")
public class WmsInstockOrderController extends BaseController {
private final IWmsInstockOrderService wmsInstockOrderService;
/**
*
*/
@SaCheckPermission("system:instockOrder:list")
@GetMapping("/list")
public TableDataInfo<WmsInstockOrderVo> list(WmsInstockOrderBo bo, PageQuery pageQuery) {
return wmsInstockOrderService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("system:instockOrder:export")
@Log(title = "入库单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsInstockOrderBo bo, HttpServletResponse response) {
List<WmsInstockOrderVo> list = wmsInstockOrderService.queryList(bo);
ExcelUtil.exportExcel(list, "入库单", WmsInstockOrderVo.class, response);
}
/**
*
*
* @param instockId
*/
// @SaCheckPermission("system:instockOrder:query")
@GetMapping("/{instockId}")
public R<WmsInstockOrderVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long instockId) {
return R.ok(wmsInstockOrderService.queryById(instockId));
}
/**
*
*/
@SaCheckPermission("system:instockOrder:add")
@Log(title = "入库单", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add( @RequestBody WmsInstockOrderBo bo) {
return toAjax(wmsInstockOrderService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("system:instockOrder:edit")
@Log(title = "入库单", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsInstockOrderBo bo) {
return toAjax(wmsInstockOrderService.updateByBo(bo));
}
/**
*
*
* @param instockIds
*/
@SaCheckPermission("system:instockOrder:remove")
@Log(title = "入库单", businessType = BusinessType.DELETE)
@DeleteMapping("/{instockIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] instockIds) {
return toAjax(wmsInstockOrderService.deleteWithValidByIds(List.of(instockIds), true));
}
}

@ -0,0 +1,112 @@
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.WmsInstockPrintBo;
import org.dromara.wms.domain.vo.WmsInstockPrintVo;
import org.dromara.wms.service.IWmsInstockPrintService;
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/instockPrint
*
* @author LionLi
* @date 2025-01-07
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/instockPrint")
public class WmsInstockPrintController extends BaseController {
private final IWmsInstockPrintService wmsInstockPrintService;
/**
* -
*/
@SaCheckPermission("system:instockPrint:list")
@GetMapping("/list")
public TableDataInfo<WmsInstockPrintVo> list(WmsInstockPrintBo bo, PageQuery pageQuery) {
return wmsInstockPrintService.queryPageList(bo, pageQuery);
}
/**
* -
*/
@SaCheckPermission("system:instockPrint:export")
@Log(title = "入库单-物料打印条码", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsInstockPrintBo bo, HttpServletResponse response) {
List<WmsInstockPrintVo> list = wmsInstockPrintService.queryList(bo);
ExcelUtil.exportExcel(list, "入库单-物料打印条码", WmsInstockPrintVo.class, response);
}
/**
* -
*
* @param instockPrintId
*/
@SaCheckPermission("system:instockPrint:query")
@GetMapping("/{instockPrintId}")
public R<WmsInstockPrintVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long instockPrintId) {
return R.ok(wmsInstockPrintService.queryById(instockPrintId));
}
/**
* -
*/
@SaCheckPermission("system:instockPrint:add")
@Log(title = "入库单-物料打印条码", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsInstockPrintBo bo) {
return toAjax(wmsInstockPrintService.insertByBo(bo));
}
/**
* -
*/
@SaCheckPermission("system:instockPrint:edit")
@Log(title = "入库单-物料打印条码", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsInstockPrintBo bo) {
return toAjax(wmsInstockPrintService.updateByBo(bo));
}
/**
* -
*
* @param instockPrintIds
*/
@SaCheckPermission("system:instockPrint:remove")
@Log(title = "入库单-物料打印条码", businessType = BusinessType.DELETE)
@DeleteMapping("/{instockPrintIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] instockPrintIds) {
return toAjax(wmsInstockPrintService.deleteWithValidByIds(List.of(instockPrintIds), true));
}
@PostMapping("/print")
public R<String> print(@RequestBody WmsInstockPrintBo bo){
List<WmsInstockPrintVo> vos = bo.getVos();
return null;
}
}

@ -0,0 +1,116 @@
package org.dromara.wms.controller;
import java.math.BigDecimal;
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.WmsInventory;
import org.dromara.wms.domain.bo.WmsInventoryBo;
import org.dromara.wms.domain.vo.WmsInventoryVo;
import org.dromara.wms.service.IWmsInventoryService;
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/inventory
*
* @author LionLi
* @date 2025-01-07
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/inventory")
public class WmsInventoryController extends BaseController {
private final IWmsInventoryService wmsInventoryService;
/**
*
*/
@SaCheckPermission("system:inventory:list")
@GetMapping("/list")
public TableDataInfo<WmsInventoryVo> list(WmsInventoryBo bo, PageQuery pageQuery) {
return wmsInventoryService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("system:inventory:export")
@Log(title = "物料库存", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsInventoryBo bo, HttpServletResponse response) {
List<WmsInventoryVo> list = wmsInventoryService.queryList(bo);
ExcelUtil.exportExcel(list, "物料库存", WmsInventoryVo.class, response);
}
/**
*
*
* @param inventoryId
*/
@SaCheckPermission("system:inventory:query")
@GetMapping("/{inventoryId}")
public R<WmsInventoryVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long inventoryId) {
return R.ok(wmsInventoryService.queryById(inventoryId));
}
/**
*
*/
@SaCheckPermission("system:inventory:add")
@Log(title = "物料库存", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsInventoryBo bo) {
return toAjax(wmsInventoryService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("system:inventory:edit")
@Log(title = "物料库存", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsInventoryBo bo) {
return toAjax(wmsInventoryService.updateByBo(bo));
}
/**
*
*
* @param inventoryIds
*/
@SaCheckPermission("system:inventory:remove")
@Log(title = "物料库存", businessType = BusinessType.DELETE)
@DeleteMapping("/{inventoryIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] inventoryIds) {
return toAjax(wmsInventoryService.deleteWithValidByIds(List.of(inventoryIds), true));
}
/**
*
*/
@GetMapping("materailCount")
public R<BigDecimal> materailCount(WmsInventory materialId){
BigDecimal bigDecimal = wmsInventoryService.materailCount(materialId);
return R.ok(wmsInventoryService.materailCount(materialId));
}
}

@ -0,0 +1,107 @@
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.WmsOutstockDetailBo;
import org.dromara.wms.domain.vo.WmsOutstockDetailVo;
import org.dromara.wms.service.IWmsOutstockDetailService;
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/outstockDetail
*
* @author LionLi
* @date 2025-01-08
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/outstockDetail")
public class WmsOutstockDetailController extends BaseController {
private final IWmsOutstockDetailService wmsOutstockDetailService;
/**
* -
*/
@SaCheckPermission("system:outstockDetail:list")
@GetMapping("/list")
public TableDataInfo<WmsOutstockDetailVo> list(WmsOutstockDetailBo bo, PageQuery pageQuery) {
return wmsOutstockDetailService.queryPageList(bo, pageQuery);
}
/**
* -
*/
@SaCheckPermission("system:outstockDetail:export")
@Log(title = "出库单-物料", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsOutstockDetailBo bo, HttpServletResponse response) {
List<WmsOutstockDetailVo> list = wmsOutstockDetailService.queryList(bo);
ExcelUtil.exportExcel(list, "出库单-物料", WmsOutstockDetailVo.class, response);
}
/**
* -
*
* @param outstockDetailId
*/
@SaCheckPermission("system:outstockDetail:query")
@GetMapping("/{outstockDetailId}")
public R<WmsOutstockDetailVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long outstockDetailId) {
return R.ok(wmsOutstockDetailService.queryById(outstockDetailId));
}
/**
* -
*/
@SaCheckPermission("system:outstockDetail:add")
@Log(title = "出库单-物料", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@RequestBody WmsOutstockDetailBo bo) {
return toAjax(wmsOutstockDetailService.insertByBo(bo));
}
/**
* -
*/
@SaCheckPermission("system:outstockDetail:edit")
@Log(title = "出库单-物料", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsOutstockDetailBo bo) {
return toAjax(wmsOutstockDetailService.updateByBo(bo));
}
/**
* -
*
* @param outstockDetailIds
*/
@SaCheckPermission("system:outstockDetail:remove")
@Log(title = "出库单-物料", businessType = BusinessType.DELETE)
@DeleteMapping("/{outstockDetailIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] outstockDetailIds) {
return toAjax(wmsOutstockDetailService.deleteWithValidByIds(List.of(outstockDetailIds), true));
}
}

@ -0,0 +1,106 @@
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.WmsOutstockOrderBo;
import org.dromara.wms.domain.vo.WmsOutstockOrderVo;
import org.dromara.wms.service.IWmsOutstockOrderService;
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/outstockOrder
*
* @author LionLi
* @date 2025-01-08
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/outstockOrder")
public class WmsOutstockOrderController extends BaseController {
private final IWmsOutstockOrderService wmsOutstockOrderService;
/**
*
*/
@SaCheckPermission("system:outstockOrder:list")
@GetMapping("/list")
public TableDataInfo<WmsOutstockOrderVo> list(WmsOutstockOrderBo bo, PageQuery pageQuery) {
return wmsOutstockOrderService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("system:outstockOrder:export")
@Log(title = "出库单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsOutstockOrderBo bo, HttpServletResponse response) {
List<WmsOutstockOrderVo> list = wmsOutstockOrderService.queryList(bo);
ExcelUtil.exportExcel(list, "出库单", WmsOutstockOrderVo.class, response);
}
/**
*
*
* @param outstockId
*/
@SaCheckPermission("system:outstockOrder:query")
@GetMapping("/{outstockId}")
public R<WmsOutstockOrderVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long outstockId) {
return R.ok(wmsOutstockOrderService.queryById(outstockId));
}
/**
*
*/
@SaCheckPermission("system:outstockOrder:add")
@Log(title = "出库单", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsOutstockOrderBo bo) {
return toAjax(wmsOutstockOrderService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("system:outstockOrder:edit")
@Log(title = "出库单", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsOutstockOrderBo bo) {
return toAjax(wmsOutstockOrderService.updateByBo(bo));
}
/**
*
*
* @param outstockIds
*/
@SaCheckPermission("system:outstockOrder:remove")
@Log(title = "出库单", businessType = BusinessType.DELETE)
@DeleteMapping("/{outstockIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] outstockIds) {
return toAjax(wmsOutstockOrderService.deleteWithValidByIds(List.of(outstockIds), true));
}
}

@ -0,0 +1,106 @@
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.WmsReturnOrderBo;
import org.dromara.wms.domain.vo.WmsReturnOrderVo;
import org.dromara.wms.service.IWmsReturnOrderService;
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/returnOrder
*
* @author LionLi
* @date 2025-01-09
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/returnOrder")
public class WmsReturnOrderController extends BaseController {
private final IWmsReturnOrderService wmsReturnOrderService;
/**
* 退
*/
@SaCheckPermission("system:returnOrder:list")
@GetMapping("/list")
public TableDataInfo<WmsReturnOrderVo> list(WmsReturnOrderBo bo, PageQuery pageQuery) {
return wmsReturnOrderService.queryPageList(bo, pageQuery);
}
/**
* 退
*/
@SaCheckPermission("system:returnOrder:export")
@Log(title = "退库工单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsReturnOrderBo bo, HttpServletResponse response) {
List<WmsReturnOrderVo> list = wmsReturnOrderService.queryList(bo);
ExcelUtil.exportExcel(list, "退库工单", WmsReturnOrderVo.class, response);
}
/**
* 退
*
* @param roId
*/
@SaCheckPermission("system:returnOrder:query")
@GetMapping("/{roId}")
public R<WmsReturnOrderVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long roId) {
return R.ok(wmsReturnOrderService.queryById(roId));
}
/**
* 退
*/
@SaCheckPermission("system:returnOrder:add")
@Log(title = "退库工单", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsReturnOrderBo bo) {
return toAjax(wmsReturnOrderService.insertByBo(bo));
}
/**
* 退
*/
@SaCheckPermission("system:returnOrder:edit")
@Log(title = "退库工单", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsReturnOrderBo bo) {
return toAjax(wmsReturnOrderService.updateByBo(bo));
}
/**
* 退
*
* @param roIds
*/
@SaCheckPermission("system:returnOrder:remove")
@Log(title = "退库工单", businessType = BusinessType.DELETE)
@DeleteMapping("/{roIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] roIds) {
return toAjax(wmsReturnOrderService.deleteWithValidByIds(List.of(roIds), true));
}
}

@ -64,7 +64,7 @@ public class WmsConfiguration {
/**
* id
*/
private int tenantId;
private String tenantId;
@TableField(fill = FieldFill.INSERT)
private String createBy;
@ -86,5 +86,8 @@ public class WmsConfiguration {
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
@TableField(exist = false)
private String warehouseCode;//字段映射
}

@ -0,0 +1,123 @@
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.io.Serial;
import java.util.Date;
/**
* - wms_instock_detail
*
* @author LionLi
* @date 2025-01-06
*/
@Data
//@EqualsAndHashCode(callSuper = true)
@TableName("wms_instock_detail")
public class WmsInstockDetail{
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private Long instockDetailId;
/**
*
*/
private Long instockId;
/**
*
*/
private String instockCode;
/**
* -
*/
private Long dnDId;
/**
* -
*/
private Long poDId;
/**
* id
*/
private Long materialId;
/**
*
*/
private String materialCode;
/**
*
*/
private String materialName;
/**
*
*/
private Long instockQty;
/**
*
*/
private String materialSpe;
/**
*
*/
private String unitName;
/**
*
*/
private String codeYesNo;
/**
*
*/
private String materialCategories;
/**
* 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 Integer printNum;
/**
*
*/
private Integer printedNum;
}

@ -0,0 +1,104 @@
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_instock_order
*
* @author LionLi
* @date 2025-01-06
*/
@Data
//@EqualsAndHashCode(callSuper = true)
@TableName("wms_instock_order")
public class WmsInstockOrder{
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private Long instockId;
/**
*
*/
private String instockCode;
/**
*
*/
private String materialCategories;
/**
* (1,2,3,4)
*/
private String instockType;
/**
*
*/
private String orderNo;
/**
*
*/
private String auditBy;
/**
*
*/
private Date auditTime;
/**
* (0,1,2)
*/
private String auditStatus;
/**
*
*/
private String auditComments;
/**
* ID
*/
private Long warehouseId;
@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;
/**
* id
*/
private String tenantId;
@TableField(exist = false)
private String warehouseCode;//字段映射
}

@ -0,0 +1,112 @@
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.io.Serial;
import java.util.Date;
/**
* - wms_instock_print
*
* @author LionLi
* @date 2025-01-07
*/
@Data
//@EqualsAndHashCode(callSuper = true)
@TableName("wms_instock_print")
public class WmsInstockPrint{
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.AUTO)
private Long instockPrintId;
/**
*
*/
private String instockCode;
/**
*
*/
private String batchCode;
/**
*
*/
private Long materialQty;
/**
*
*/
private Long apportionQty;
/**
* id
*/
private Long materialId;
/**
*
*/
private String materialCode;
/**
*
*/
private String materialName;
/**
*
*/
private String materialSpe;
/**
*
*/
private String unitName;
/**
*
*/
private String codeYesNo;
/**
*
*/
private String materialCategories;
@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;
/**
* id
*/
private String tenantId;
}

@ -0,0 +1,98 @@
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.io.Serial;
import java.math.BigDecimal;
import java.util.Date;
/**
* wms_inventory
*
* @author LionLi
* @date 2025-01-07
*/
@Data
@TableName("wms_inventory")
public class WmsInventory{
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.AUTO)
private Long inventoryId;
/**
*
*/
private String batchCode;
/**
* id
*/
private Long materialId;
/**
*
*/
private String locationCode;
/**
*
*/
private Long materialCategories;
/**
*
*/
private BigDecimal inventoryQty;
/**
* 01
*/
private String lockState;
/**
* 001
*/
private String inventoryStatus;
/**
* ID
*/
private Long storeId;
/**
* 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,86 @@
package org.dromara.wms.domain;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.ibm.icu.math.BigDecimal;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
import java.util.Date;
/**
* - wms_outstock_detail
*
* @author LionLi
* @date 2025-01-08
*/
@Data
@TableName("wms_outstock_detail")
public class WmsOutstockDetail {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.AUTO)
private Long outstockDetailId;
/**
*
*/
private String outstockCode;
/**
*
*/
private Long outstockId;
/**
* id
*/
private Long materialId;
/**
*
*/
@TableField(typeHandler = JacksonTypeHandler.class)
private BigDecimal outstockQty;
/**
*
*/
private String materialCategories;
/**
* 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 materialCode;
}

@ -0,0 +1,108 @@
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_outstock_order
*
* @author LionLi
* @date 2025-01-08
*/
@Data
@TableName("wms_outstock_order")
public class WmsOutstockOrder {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.AUTO)
private Long outstockId;
/**
* ID
*/
private Long warehouseId;
/**
*
*/
private String outstockCode;
/**
*
*/
private String outstockType;
/**
*
*/
private String materialCategories;
/**
* (1,2,3,4)
*/
private String orderType;
/**
*
*/
private String orderNo;
/**
*
*/
private String auditBy;
/**
*
*/
private Date auditTime;
/**
* (0,1,2)
*/
private String auditStatus;
/**
*
*/
private String auditComments;
/**
* 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,131 @@
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_return_order
*
* @author LionLi
* @date 2025-01-09
*/
@Data
@TableName("wms_return_order")
public class WmsReturnOrder {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private Long roId;
/**
* ID
*/
private Long materialId;
/**
*
*/
private String materialCategories;
/**
*
*/
private String batchCode;
/**
*
*/
private Long planAmount;
/**
* ID
*/
private Long warehouseId;
/**
* 退
*/
private String planLocationCode;
/**
* 退
*/
private String orderStatus;
/**
*
*/
private Long returnAmount;
/**
* 退
*/
private String returnLocationCode;
/**
*
*/
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;//字段映射
}

@ -71,7 +71,8 @@ public class WmsConfigurationBo extends BaseEntity {
/**
* id
*/
private int tenantId;
private String tenantId;
}

@ -0,0 +1,115 @@
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 org.dromara.wms.domain.WmsInstockDetail;
/**
* - wms_instock_detail
*
* @author LionLi
* @date 2025-01-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsInstockDetail.class, reverseConvertGenerate = false)
public class WmsInstockDetailBo extends BaseEntity {
/**
*
*/
@NotNull(message = "入库单子表主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long instockDetailId;
/**
*
*/
@NotNull(message = "入库单 主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long instockId;
/**
*
*/
@NotBlank(message = "入库单号不能为空", groups = { AddGroup.class, EditGroup.class })
private String instockCode;
/**
* -
*/
@NotNull(message = "送货-物料表主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long dnDId;
/**
* -
*/
@NotNull(message = "采购-物料表主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long poDId;
/**
* id
*/
@NotNull(message = "物料id不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialId;
/**
*
*/
@NotBlank(message = "物料编码不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialCode;
/**
*
*/
@NotBlank(message = "物料名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialName;
/**
*
*/
@NotNull(message = "入库数量不能为空", groups = { AddGroup.class, EditGroup.class })
private Long instockQty;
/**
*
*/
@NotBlank(message = "物料规格不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialSpe;
/**
*
*/
@NotBlank(message = "计量单位名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String unitName;
/**
*
*/
@NotBlank(message = "是否有条码不能为空", groups = { AddGroup.class, EditGroup.class })
private String codeYesNo;
/**
*
*/
@NotBlank(message = "物料大类不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialCategories;
/**
* id
*/
private String tenantId;
/**
*
*/
private Integer printNum;
/**
*
*/
private Integer printedNum;
private Long barcodeNum;
}

@ -0,0 +1,91 @@
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.WmsInstockOrder;
/**
* wms_instock_order
*
* @author LionLi
* @date 2025-01-06
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsInstockOrder.class, reverseConvertGenerate = false)
public class WmsInstockOrderBo extends BaseEntity {
/**
*
*/
@NotNull(message = "入库单 主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long instockId;
/**
*
*/
@NotBlank(message = "入库单号不能为空", groups = { AddGroup.class, EditGroup.class })
private String instockCode;
/**
*
*/
@NotBlank(message = "物料大类不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialCategories;
/**
* (1,2,3,4)
*/
@NotBlank(message = "工单类型(1采购订单,2生产订单,3手工,4系统生成)不能为空", groups = { AddGroup.class, EditGroup.class })
private String instockType;
/**
*
*/
@NotBlank(message = "订单编号不能为空", groups = { AddGroup.class, EditGroup.class })
private String orderNo;
/**
*
*/
@NotBlank(message = "审核人不能为空", groups = { AddGroup.class, EditGroup.class })
private String auditBy;
/**
*
*/
@NotNull(message = "审核时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date auditTime;
/**
* (0,1,2)
*/
@NotBlank(message = "审核状态(0待审核,1审核通过,2审核未通过)不能为空", groups = { AddGroup.class, EditGroup.class })
private String auditStatus;
/**
*
*/
@NotBlank(message = "审核意见不能为空", groups = { AddGroup.class, EditGroup.class })
private String auditComments;
/**
* ID
*/
@NotNull(message = "仓库ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long warehouseId;
/**
* id
*/
private String tenantId;
}

@ -0,0 +1,101 @@
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 org.dromara.wms.domain.WmsInstockPrint;
import org.dromara.wms.domain.vo.WmsInstockPrintVo;
import java.util.List;
/**
* - wms_instock_print
*
* @author LionLi
* @date 2025-01-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsInstockPrint.class, reverseConvertGenerate = false)
public class WmsInstockPrintBo extends BaseEntity {
/**
*
*/
// @NotNull(message = "入库单子表主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long instockPrintId;
/**
*
*/
// @NotBlank(message = "入库单号不能为空", groups = { AddGroup.class, EditGroup.class })
private String instockCode;
/**
*
*/
// @NotBlank(message = "批次码不能为空", groups = { AddGroup.class, EditGroup.class })
private String batchCode;
/**
*
*/
// @NotNull(message = "条码数量不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialQty;
/**
*
*/
// @NotNull(message = "分包数量不能为空", groups = { AddGroup.class, EditGroup.class })
private Long apportionQty;
/**
* id
*/
// @NotNull(message = "物料id不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialId;
/**
*
*/
// @NotBlank(message = "物料编码不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialCode;
/**
*
*/
// @NotBlank(message = "物料名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialName;
/**
*
*/
// @NotBlank(message = "物料规格不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialSpe;
/**
*
*/
// @NotBlank(message = "计量单位名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String unitName;
/**
*
*/
// @NotBlank(message = "是否有条码不能为空", groups = { AddGroup.class, EditGroup.class })
private String codeYesNo;
/**
*
*/
// @NotBlank(message = "物料大类不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialCategories;
private String tenantId;
private List<WmsInstockPrintVo> vos;
}

@ -0,0 +1,80 @@
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 org.dromara.wms.domain.WmsInventory;
import java.math.BigDecimal;
/**
* wms_inventory
*
* @author LionLi
* @date 2025-01-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsInventory.class, reverseConvertGenerate = false)
public class WmsInventoryBo extends BaseEntity {
/**
*
*/
@NotNull(message = "表主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long inventoryId;
/**
*
*/
@NotBlank(message = "批次码不能为空", groups = { AddGroup.class, EditGroup.class })
private String batchCode;
/**
* id
*/
@NotNull(message = "物料id不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialId;
/**
*
*/
@NotBlank(message = "库位编码不能为空", groups = { AddGroup.class, EditGroup.class })
private String locationCode;
/**
*
*/
@NotNull(message = "物料大类不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialCategories;
/**
*
*/
@NotNull(message = "库存数量不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal inventoryQty;
/**
* 01
*/
@NotBlank(message = "锁定状态0未锁定1锁定不能为空", groups = { AddGroup.class, EditGroup.class })
private String lockState;
/**
* 001
*/
@NotBlank(message = "库存状态0库存归01正常不能为空", groups = { AddGroup.class, EditGroup.class })
private String inventoryStatus;
/**
* ID
*/
@NotNull(message = "仓库ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long storeId;
private String tenantId;
}

@ -0,0 +1,62 @@
package org.dromara.wms.domain.bo;
import com.ibm.icu.math.BigDecimal;
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 org.dromara.wms.domain.WmsOutstockDetail;
/**
* - wms_outstock_detail
*
* @author LionLi
* @date 2025-01-08
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsOutstockDetail.class, reverseConvertGenerate = false)
public class WmsOutstockDetailBo extends BaseEntity {
/**
*
*/
// @NotNull(message = "表主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long outstockDetailId;
/**
*
*/
// @NotBlank(message = "出库单号不能为空", groups = { AddGroup.class, EditGroup.class })
private String outstockCode;
/**
*
*/
// @NotNull(message = "出库单 主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long outstockId;
/**
* id
*/
// @NotNull(message = "物料id不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialId;
/**
*
*/
// @NotNull(message = "出库数量不能为空", groups = { AddGroup.class, EditGroup.class })
private BigDecimal outstockQty;
/**
*
*/
// @NotBlank(message = "物料大类不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialCategories;
private String tenantId;
}

@ -0,0 +1,93 @@
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.WmsOutstockOrder;
/**
* wms_outstock_order
*
* @author LionLi
* @date 2025-01-08
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsOutstockOrder.class, reverseConvertGenerate = false)
public class WmsOutstockOrderBo extends BaseEntity {
/**
*
*/
// @NotNull(message = "出库单 主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long outstockId;
/**
* ID
*/
// @NotNull(message = "仓库ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long warehouseId;
/**
*
*/
// @NotBlank(message = "出库单号不能为空", groups = { AddGroup.class, EditGroup.class })
private String outstockCode;
/**
*
*/
// @NotBlank(message = "出库类型不能为空", groups = { AddGroup.class, EditGroup.class })
private String outstockType;
/**
*
*/
// @NotBlank(message = "物料大类不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialCategories;
/**
* (1,2,3,4)
*/
// @NotBlank(message = "工单类型(字典1销售订单,2生产订单,3手工,4系统生成)不能为空", groups = { AddGroup.class, EditGroup.class })
private String orderType;
/**
*
*/
// @NotBlank(message = "订单编号不能为空", groups = { AddGroup.class, EditGroup.class })
private String orderNo;
/**
*
*/
// @NotBlank(message = "审核人不能为空", groups = { AddGroup.class, EditGroup.class })
private String auditBy;
/**
*
*/
// @NotNull(message = "审核时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date auditTime;
/**
* (0,1,2)
*/
// @NotBlank(message = "审核状态(0待审核,1审核通过,2审核未通过)不能为空", groups = { AddGroup.class, EditGroup.class })
private String auditStatus;
/**
*
*/
// @NotBlank(message = "审核意见不能为空", groups = { AddGroup.class, EditGroup.class })
private String auditComments;
private String tenantId;
}

@ -0,0 +1,122 @@
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.WmsReturnOrder;
/**
* 退 wms_return_order
*
* @author LionLi
* @date 2025-01-09
*/
@Data
@AutoMapper(target = WmsReturnOrder.class, reverseConvertGenerate = false)
public class WmsReturnOrderBo extends BaseEntity{
/**
*
*/
// @NotNull(message = "表主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long roId;
/**
* ID
*/
// @NotNull(message = "物料ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialId;
/**
*
*/
// @NotBlank(message = "物料大类不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialCategories;
/**
*
*/
// @NotBlank(message = "批次条码不能为空", groups = { AddGroup.class, EditGroup.class })
private String batchCode;
/**
*
*/
// @NotNull(message = "计划数量不能为空", groups = { AddGroup.class, EditGroup.class })
private Long planAmount;
/**
* ID
*/
// @NotNull(message = "仓库ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long warehouseId;
/**
* 退
*/
// @NotBlank(message = "计划退库库位不能为空", groups = { AddGroup.class, EditGroup.class })
private String planLocationCode;
/**
* 退
*/
// @NotBlank(message = "退库工单状态不能为空", groups = { AddGroup.class, EditGroup.class })
private String orderStatus;
/**
*
*/
// @NotNull(message = "实际数量不能为空", groups = { AddGroup.class, EditGroup.class })
private Long returnAmount;
/**
* 退
*/
// @NotBlank(message = "实际退库库位不能为空", groups = { AddGroup.class, EditGroup.class })
private String returnLocationCode;
/**
*
*/
// @NotBlank(message = "审核人不能为空", groups = { AddGroup.class, EditGroup.class })
private String auditBy;
/**
*
*/
// @NotNull(message = "审核时间不能为空", groups = { AddGroup.class, EditGroup.class })
private Date auditTime;
/**
* (0,1,2)
*/
// @NotBlank(message = "审核状态(0待审核,1审核通过,2审核未通过)不能为空", groups = { AddGroup.class, EditGroup.class })
private String auditStatus;
/**
*
*/
// @NotBlank(message = "审核意见不能为空", groups = { AddGroup.class, EditGroup.class })
private String auditComments;
/**
* erp
*/
// @NotBlank(message = "erp同步状态不能为空", groups = { AddGroup.class, EditGroup.class })
private String erpSynchronousStatus;
/**
* erp
*/
// @NotNull(message = "erp同步数量不能为空", groups = { AddGroup.class, EditGroup.class })
private Long erpSynchronousQty;
private String tenantId;
}

@ -99,6 +99,10 @@ public class WmsConfigurationVo implements Serializable {
@ExcelProperty(value = "审批范围", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "0=所有仓库1仓库")
private String approveRange;
/**
* id
*/
private String tenantId;
private String warehouseCode;
}

@ -0,0 +1,140 @@
package org.dromara.wms.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
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.WmsInstockDetail;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* - wms_instock_detail
*
* @author LionLi
* @date 2025-01-06
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsInstockDetail.class)
public class WmsInstockDetailVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "入库单子表主键")
private Long instockDetailId;
/**
*
*/
@ExcelProperty(value = "入库单 主键")
private Long instockId;
/**
*
*/
@ExcelProperty(value = "入库单号")
private String instockCode;
/**
* -
*/
@ExcelProperty(value = "送货-物料表主键")
private Long dnDId;
/**
* -
*/
@ExcelProperty(value = "采购-物料表主键")
private Long poDId;
/**
* id
*/
@ExcelProperty(value = "物料id")
private Long materialId;
/**
*
*/
@ExcelProperty(value = "物料编码")
private String materialCode;
/**
*
*/
@ExcelProperty(value = "物料名称")
private String materialName;
/**
*
*/
@ExcelProperty(value = "入库数量")
private Long instockQty;
/**
*
*/
@ExcelProperty(value = "物料规格")
private String materialSpe;
/**
*
*/
@ExcelProperty(value = "计量单位名称")
private String unitName;
/**
*
*/
@ExcelProperty(value = "是否有条码")
private String codeYesNo;
/**
*
*/
@ExcelProperty(value = "物料大类")
private String materialCategories;
@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 Integer printedNum;
/**
* id
*/
private String tenantId;
}

@ -0,0 +1,102 @@
package org.dromara.wms.domain.vo;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.wms.domain.WmsInstockOrder;
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 java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* wms_instock_order
*
* @author LionLi
* @date 2025-01-06
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsInstockOrder.class)
public class WmsInstockOrderVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "入库单 主键")
private Long instockId;
/**
*
*/
@ExcelProperty(value = "入库单号")
private String instockCode;
/**
*
*/
@ExcelProperty(value = "物料大类")
private String materialCategories;
/**
* (1,2,3,4)
*/
@ExcelProperty(value = "工单类型(1采购订单,2生产订单,3手工,4系统生成)")
private String instockType;
/**
*
*/
@ExcelProperty(value = "订单编号")
private String orderNo;
/**
*
*/
@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;
/**
* ID
*/
@ExcelProperty(value = "仓库ID")
private Long warehouseId;
/**
* id
*/
private String tenantId;
private String warehouseCode;//字段映射
}

@ -0,0 +1,110 @@
package org.dromara.wms.domain.vo;
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.WmsInstockPrint;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* - wms_instock_print
*
* @author LionLi
* @date 2025-01-07
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsInstockPrint.class)
public class WmsInstockPrintVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "入库单子表主键")
private Long instockPrintId;
/**
*
*/
@ExcelProperty(value = "入库单号")
private String instockCode;
/**
*
*/
@ExcelProperty(value = "批次码")
private String batchCode;
/**
*
*/
@ExcelProperty(value = "条码数量")
private Long materialQty;
/**
*
*/
@ExcelProperty(value = "分包数量")
private Long apportionQty;
/**
* id
*/
@ExcelProperty(value = "物料id")
private Long materialId;
/**
*
*/
@ExcelProperty(value = "物料编码")
private String materialCode;
/**
*
*/
@ExcelProperty(value = "物料名称")
private String materialName;
/**
*
*/
@ExcelProperty(value = "物料规格")
private String materialSpe;
/**
*
*/
@ExcelProperty(value = "计量单位名称")
private String unitName;
/**
*
*/
@ExcelProperty(value = "是否有条码")
private String codeYesNo;
/**
*
*/
@ExcelProperty(value = "物料大类")
private String materialCategories;
/**
* id
*/
private String tenantId;
}

@ -0,0 +1,117 @@
package org.dromara.wms.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
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.WmsInventory;
import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* wms_inventory
*
* @author LionLi
* @date 2025-01-07
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsInventory.class)
public class WmsInventoryVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "表主键")
private Long inventoryId;
/**
*
*/
@ExcelProperty(value = "批次码")
private String batchCode;
/**
* id
*/
@ExcelProperty(value = "物料id")
private Long materialId;
/**
*
*/
@ExcelProperty(value = "库位编码")
private String locationCode;
/**
*
*/
@ExcelProperty(value = "物料大类")
private Long materialCategories;
/**
*
*/
@ExcelProperty(value = "库存数量")
private BigDecimal inventoryQty;
/**
* 01
*/
@ExcelProperty(value = "锁定状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "0=未锁定1锁定")
private String lockState;
/**
* 001
*/
@ExcelProperty(value = "库存状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "0=库存归01正常")
private String inventoryStatus;
/**
* ID
*/
@ExcelProperty(value = "仓库ID")
private Long storeId;
/**
* 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;//字段映射
}

@ -0,0 +1,97 @@
package org.dromara.wms.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.ibm.icu.math.BigDecimal;
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.WmsOutstockDetail;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* - wms_outstock_detail
*
* @author LionLi
* @date 2025-01-08
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsOutstockDetail.class)
public class WmsOutstockDetailVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "表主键")
private Long outstockDetailId;
/**
*
*/
@ExcelProperty(value = "出库单号")
private String outstockCode;
/**
*
*/
@ExcelProperty(value = "出库单 主键")
private Long outstockId;
/**
* id
*/
@ExcelProperty(value = "物料id")
private Long materialId;
/**
*
*/
@ExcelProperty(value = "出库数量")
private BigDecimal outstockQty;
/**
*
*/
@ExcelProperty(value = "物料大类")
private String materialCategories;
/**
* 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 materialCode;
}

@ -0,0 +1,128 @@
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.WmsOutstockOrder;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* wms_outstock_order
*
* @author LionLi
* @date 2025-01-08
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsOutstockOrder.class)
public class WmsOutstockOrderVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "出库单 主键")
private Long outstockId;
/**
* ID
*/
@ExcelProperty(value = "仓库ID")
private Long warehouseId;
/**
*
*/
@ExcelProperty(value = "出库单号")
private String outstockCode;
/**
*
*/
@ExcelProperty(value = "出库类型")
private String outstockType;
/**
*
*/
@ExcelProperty(value = "物料大类")
private String materialCategories;
/**
* (1,2,3,4)
*/
@ExcelProperty(value = "工单类型(字典1销售订单,2生产订单,3手工,4系统生成)")
private String orderType;
/**
*
*/
@ExcelProperty(value = "订单编号")
private String orderNo;
/**
*
*/
@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;
/**
* 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;//字段映射
}

@ -0,0 +1,157 @@
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.WmsReturnOrder;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* 退 wms_return_order
*
* @author LionLi
* @date 2025-01-09
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsReturnOrder.class)
public class WmsReturnOrderVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "表主键")
private Long roId;
/**
* ID
*/
@ExcelProperty(value = "物料ID")
private Long materialId;
/**
*
*/
@ExcelProperty(value = "物料大类")
private String materialCategories;
/**
*
*/
@ExcelProperty(value = "批次条码")
private String batchCode;
/**
*
*/
@ExcelProperty(value = "计划数量")
private Long planAmount;
/**
* ID
*/
@ExcelProperty(value = "仓库ID")
private Long warehouseId;
/**
* 退
*/
@ExcelProperty(value = "计划退库库位")
private String planLocationCode;
/**
* 退
*/
@ExcelProperty(value = "退库工单状态")
private String orderStatus;
/**
*
*/
@ExcelProperty(value = "实际数量")
private Long returnAmount;
/**
* 退
*/
@ExcelProperty(value = "实际退库库位")
private String returnLocationCode;
/**
*
*/
@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;
private String warehouseCode;//字段映射
}

@ -1,5 +1,6 @@
package org.dromara.wms.mapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
@ -18,4 +19,6 @@ public interface WmsConfigurationMapper extends BaseMapperPlus<WmsConfiguration,
int insertConfiguration(@Param("entity") WmsConfiguration entity);
int selectNum();
int updateByconfigurationId(WmsConfiguration wmsConfiguration);
}

@ -0,0 +1,16 @@
package org.dromara.wms.mapper;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.WmsInstockDetail;
import org.dromara.wms.domain.vo.WmsInstockDetailVo;
/**
* -Mapper
*
* @author LionLi
* @date 2025-01-06
*/
public interface WmsInstockDetailMapper extends BaseMapperPlus<WmsInstockDetail, WmsInstockDetailVo> {
int updateDetail(WmsInstockDetail update);
}

@ -0,0 +1,16 @@
package org.dromara.wms.mapper;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.WmsInstockOrder;
import org.dromara.wms.domain.vo.WmsInstockOrderVo;
/**
* Mapper
*
* @author LionLi
* @date 2025-01-06
*/
public interface WmsInstockOrderMapper extends BaseMapperPlus<WmsInstockOrder, WmsInstockOrderVo> {
int updateInstock(WmsInstockOrder update);
}

@ -0,0 +1,15 @@
package org.dromara.wms.mapper;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.WmsInstockPrint;
import org.dromara.wms.domain.vo.WmsInstockPrintVo;
/**
* -Mapper
*
* @author LionLi
* @date 2025-01-07
*/
public interface WmsInstockPrintMapper extends BaseMapperPlus<WmsInstockPrint, WmsInstockPrintVo> {
}

@ -0,0 +1,20 @@
package org.dromara.wms.mapper;
import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.WmsInventory;
import org.dromara.wms.domain.vo.WmsInventoryVo;
import org.springframework.web.bind.annotation.PostMapping;
import java.math.BigDecimal;
/**
* Mapper
*
* @author LionLi
* @date 2025-01-07
*/
public interface WmsInventoryMapper extends BaseMapperPlus<WmsInventory, WmsInventoryVo> {
BigDecimal materailCount(@Param("entity") WmsInventory wmsInventory);
}

@ -0,0 +1,15 @@
package org.dromara.wms.mapper;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.WmsOutstockDetail;
import org.dromara.wms.domain.vo.WmsOutstockDetailVo;
/**
* -Mapper
*
* @author LionLi
* @date 2025-01-08
*/
public interface WmsOutstockDetailMapper extends BaseMapperPlus<WmsOutstockDetail, WmsOutstockDetailVo> {
}

@ -0,0 +1,15 @@
package org.dromara.wms.mapper;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.WmsOutstockOrder;
import org.dromara.wms.domain.vo.WmsOutstockOrderVo;
/**
* Mapper
*
* @author LionLi
* @date 2025-01-08
*/
public interface WmsOutstockOrderMapper extends BaseMapperPlus<WmsOutstockOrder, WmsOutstockOrderVo> {
}

@ -0,0 +1,15 @@
package org.dromara.wms.mapper;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.WmsReturnOrder;
import org.dromara.wms.domain.vo.WmsReturnOrderVo;
/**
* 退Mapper
*
* @author LionLi
* @date 2025-01-09
*/
public interface WmsReturnOrderMapper extends BaseMapperPlus<WmsReturnOrder, WmsReturnOrderVo> {
}

@ -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.WmsInstockDetailBo;
import org.dromara.wms.domain.vo.WmsInstockDetailVo;
import java.util.Collection;
import java.util.List;
/**
* -Service
*
* @author LionLi
* @date 2025-01-06
*/
public interface IWmsInstockDetailService {
/**
* -
*
* @param instockDetailId
* @return -
*/
WmsInstockDetailVo queryById(Long instockDetailId);
/**
* -
*
* @param bo
* @param pageQuery
* @return -
*/
TableDataInfo<WmsInstockDetailVo> queryPageList(WmsInstockDetailBo bo, PageQuery pageQuery);
/**
* -
*
* @param bo
* @return -
*/
List<WmsInstockDetailVo> queryList(WmsInstockDetailBo bo);
/**
* -
*
* @param bo -
* @return
*/
Boolean insertByBo(WmsInstockDetailBo bo);
/**
* -
*
* @param bo -
* @return
*/
Boolean updateByBo(WmsInstockDetailBo 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.WmsInstockOrderBo;
import org.dromara.wms.domain.vo.WmsInstockOrderVo;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author LionLi
* @date 2025-01-06
*/
public interface IWmsInstockOrderService {
/**
*
*
* @param instockId
* @return
*/
WmsInstockOrderVo queryById(Long instockId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<WmsInstockOrderVo> queryPageList(WmsInstockOrderBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsInstockOrderVo> queryList(WmsInstockOrderBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(WmsInstockOrderBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(WmsInstockOrderBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,73 @@
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.WmsInstockPrint;
import org.dromara.wms.domain.bo.WmsInstockDetailBo;
import org.dromara.wms.domain.bo.WmsInstockPrintBo;
import org.dromara.wms.domain.vo.WmsInstockPrintVo;
import java.util.Collection;
import java.util.List;
/**
* -Service
*
* @author LionLi
* @date 2025-01-07
*/
public interface IWmsInstockPrintService {
/**
* -
*
* @param instockPrintId
* @return -
*/
WmsInstockPrintVo queryById(Long instockPrintId);
/**
* -
*
* @param bo
* @param pageQuery
* @return -
*/
TableDataInfo<WmsInstockPrintVo> queryPageList(WmsInstockPrintBo bo, PageQuery pageQuery);
/**
* -
*
* @param bo
* @return -
*/
List<WmsInstockPrintVo> queryList(WmsInstockPrintBo bo);
long queryPrintNum(WmsInstockDetailBo bo);
/**
* -
*
* @param bo -
* @return
*/
Boolean insertByBo(WmsInstockPrintBo bo);
int insertWmsInstockPrint(WmsInstockPrint wmsInstockPrint);
/**
* -
*
* @param bo -
* @return
*/
Boolean updateByBo(WmsInstockPrintBo bo);
/**
* -
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,72 @@
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.WmsInventory;
import org.dromara.wms.domain.bo.WmsInventoryBo;
import org.dromara.wms.domain.vo.WmsInventoryVo;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author LionLi
* @date 2025-01-07
*/
public interface IWmsInventoryService {
/**
*
*
* @param inventoryId
* @return
*/
WmsInventoryVo queryById(Long inventoryId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<WmsInventoryVo> queryPageList(WmsInventoryBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsInventoryVo> queryList(WmsInventoryBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(WmsInventoryBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(WmsInventoryBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
BigDecimal materailCount(WmsInventory materialId);
}

@ -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.WmsOutstockDetailBo;
import org.dromara.wms.domain.vo.WmsOutstockDetailVo;
import java.util.Collection;
import java.util.List;
/**
* -Service
*
* @author LionLi
* @date 2025-01-08
*/
public interface IWmsOutstockDetailService {
/**
* -
*
* @param outstockDetailId
* @return -
*/
WmsOutstockDetailVo queryById(Long outstockDetailId);
/**
* -
*
* @param bo
* @param pageQuery
* @return -
*/
TableDataInfo<WmsOutstockDetailVo> queryPageList(WmsOutstockDetailBo bo, PageQuery pageQuery);
/**
* -
*
* @param bo
* @return -
*/
List<WmsOutstockDetailVo> queryList(WmsOutstockDetailBo bo);
/**
* -
*
* @param bo -
* @return
*/
Boolean insertByBo(WmsOutstockDetailBo bo);
/**
* -
*
* @param bo -
* @return
*/
Boolean updateByBo(WmsOutstockDetailBo 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.WmsOutstockOrderBo;
import org.dromara.wms.domain.vo.WmsOutstockOrderVo;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author LionLi
* @date 2025-01-08
*/
public interface IWmsOutstockOrderService {
/**
*
*
* @param outstockId
* @return
*/
WmsOutstockOrderVo queryById(Long outstockId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<WmsOutstockOrderVo> queryPageList(WmsOutstockOrderBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsOutstockOrderVo> queryList(WmsOutstockOrderBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(WmsOutstockOrderBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(WmsOutstockOrderBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,69 @@
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.WmsReturnOrderBo;
import org.dromara.wms.domain.vo.WmsReturnOrderVo;
import java.util.Collection;
import java.util.List;
/**
* 退Service
*
* @author LionLi
* @date 2025-01-09
*/
public interface IWmsReturnOrderService {
/**
* 退
*
* @param roId
* @return 退
*/
WmsReturnOrderVo queryById(Long roId);
/**
* 退
*
* @param bo
* @param pageQuery
* @return 退
*/
TableDataInfo<WmsReturnOrderVo> queryPageList(WmsReturnOrderBo bo, PageQuery pageQuery);
/**
* 退
*
* @param bo
* @return 退
*/
List<WmsReturnOrderVo> queryList(WmsReturnOrderBo bo);
/**
* 退
*
* @param bo 退
* @return
*/
Boolean insertByBo(WmsReturnOrderBo bo);
/**
* 退
*
* @param bo 退
* @return
*/
Boolean updateByBo(WmsReturnOrderBo bo);
/**
* 退
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -1,5 +1,8 @@
package org.dromara.wms.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import net.sf.jsqlparser.statement.Statements;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
@ -9,8 +12,14 @@ 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.common.mybatis.helper.DataPermissionHelper;
import org.dromara.system.api.model.LoginUser;
import org.dromara.wms.domain.BaseMaterialInfo;
import org.dromara.wms.domain.WmsBaseWarehouse;
import org.dromara.wms.domain.WmsConfiguration;
import org.dromara.wms.domain.WmsOutstockDetail;
import org.dromara.wms.domain.bo.WmsConfigurationBo;
import org.dromara.wms.domain.bo.WmsOutstockDetailBo;
import org.dromara.wms.domain.vo.WmsConfigurationVo;
import org.dromara.wms.mapper.WmsConfigurationMapper;
import org.dromara.wms.service.IWmsConfigurationService;
@ -41,7 +50,10 @@ public class WmsConfigurationServiceImpl implements IWmsConfigurationService {
*/
@Override
public WmsConfigurationVo queryById(Long configurationId){
return baseMapper.selectVoById(configurationId);
LambdaQueryWrapper<WmsConfiguration> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(WmsConfiguration::getConfigurationId,configurationId);
WmsConfigurationVo wmsConfigurationVo = baseMapper.selectVoOne(wrapper);
return wmsConfigurationVo;
}
/**
@ -53,7 +65,8 @@ public class WmsConfigurationServiceImpl implements IWmsConfigurationService {
*/
@Override
public TableDataInfo<WmsConfigurationVo> queryPageList(WmsConfigurationBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<WmsConfiguration> lqw = buildQueryWrapper(bo);
// LambdaQueryWrapper<WmsConfiguration> lqw = buildQueryWrapper(bo);
MPJLambdaWrapper<WmsConfiguration> lqw = buildJoinQueryWrapper(bo);
lqw.orderByDesc(WmsConfiguration::getCreateTime);
Page<WmsConfigurationVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
@ -70,6 +83,22 @@ public class WmsConfigurationServiceImpl implements IWmsConfigurationService {
LambdaQueryWrapper<WmsConfiguration> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsConfiguration> buildJoinQueryWrapper(WmsConfigurationBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsConfiguration> lqw = JoinWrappers.lambda(WmsConfiguration.class)
.selectAll(WmsConfiguration.class)
.select(WmsBaseWarehouse::getWarehouseCode)
.leftJoin(WmsBaseWarehouse.class, WmsBaseWarehouse::getWarehouseId, WmsConfiguration::getWarehouseId);
lqw.eq(bo.getConfigurationId() != null, WmsConfiguration::getConfigurationId, bo.getConfigurationId());
lqw.eq(StringUtils.isNotBlank(bo.getNodeCode()), WmsConfiguration::getNodeCode, bo.getNodeCode());
lqw.like(StringUtils.isNotBlank(bo.getNodeName()), WmsConfiguration::getNodeName, bo.getNodeName());
lqw.eq(StringUtils.isNotBlank(bo.getApproveYesNo()), WmsConfiguration::getApproveYesNo, bo.getApproveYesNo());
lqw.eq(StringUtils.isNotBlank(bo.getApproveType()), WmsConfiguration::getApproveType, bo.getApproveType());
lqw.eq(StringUtils.isNotBlank(bo.getApproveRoleCode()), WmsConfiguration::getApproveRoleCode, bo.getApproveRoleCode());
lqw.eq(bo.getWarehouseId() != null, WmsConfiguration::getWarehouseId, bo.getWarehouseId());
lqw.eq(StringUtils.isNotBlank(bo.getApproveRange()), WmsConfiguration::getApproveRange, bo.getApproveRange());
return lqw;
}
private LambdaQueryWrapper<WmsConfiguration> buildQueryWrapper(WmsConfigurationBo bo) {
Map<String, Object> params = bo.getParams();
@ -94,6 +123,9 @@ public class WmsConfigurationServiceImpl implements IWmsConfigurationService {
@Override
public Boolean insertByBo(WmsConfigurationBo bo) {
WmsConfiguration add = MapstructUtils.convert(bo, WmsConfiguration.class);
// LoginUser currentUser = DataPermissionHelper.getVariable("user");
// String tenantId = currentUser.getTenantId();
// add.setTenantId(Integer.valueOf(tenantId));
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setConfigurationId(add.getConfigurationId());
@ -111,7 +143,7 @@ public class WmsConfigurationServiceImpl implements IWmsConfigurationService {
public Boolean updateByBo(WmsConfigurationBo bo) {
WmsConfiguration update = MapstructUtils.convert(bo, WmsConfiguration.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
return baseMapper.updateByconfigurationId(update) > 0;
}
/**
@ -133,6 +165,8 @@ public class WmsConfigurationServiceImpl implements IWmsConfigurationService {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
LambdaUpdateWrapper<WmsConfiguration> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.in(WmsConfiguration::getConfigurationId,ids);
return baseMapper.delete(updateWrapper)>0;
}
}

@ -0,0 +1,190 @@
package org.dromara.wms.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.wms.domain.WmsInstockDetail;
import org.dromara.wms.domain.WmsInstockOrder;
import org.dromara.wms.domain.WmsInstockPrint;
import org.dromara.wms.domain.bo.WmsInstockDetailBo;
import org.dromara.wms.domain.vo.BaseMaterialInfoVo;
import org.dromara.wms.domain.vo.WmsInstockDetailVo;
import org.dromara.wms.mapper.WmsInstockDetailMapper;
import org.dromara.wms.service.IBaseMaterialInfoService;
import org.dromara.wms.service.IWmsInstockDetailService;
import org.dromara.wms.service.IWmsInstockPrintService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* -Service
*
* @author LionLi
* @date 2025-01-06
*/
@RequiredArgsConstructor
@Service
public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
private final WmsInstockDetailMapper baseMapper;
@Autowired
private IBaseMaterialInfoService baseMaterialInfoService;
@Autowired
private IWmsInstockPrintService wmsInstockPrintService;
/**
* -
*
* @param instockDetailId
* @return -
*/
@Override
public WmsInstockDetailVo queryById(Long instockDetailId){
LambdaQueryWrapper<WmsInstockDetail> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(WmsInstockDetail::getInstockDetailId,instockDetailId);
return baseMapper.selectVoOne(wrapper);
}
/**
* -
*
* @param bo
* @param pageQuery
* @return -
*/
@Override
public TableDataInfo<WmsInstockDetailVo> queryPageList(WmsInstockDetailBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<WmsInstockDetail> lqw = buildQueryWrapper(bo);
lqw.orderByDesc(WmsInstockDetail::getCreateTime);
Page<WmsInstockDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* -
*
* @param bo
* @return -
*/
@Override
public List<WmsInstockDetailVo> queryList(WmsInstockDetailBo bo) {
LambdaQueryWrapper<WmsInstockDetail> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<WmsInstockDetail> buildQueryWrapper(WmsInstockDetailBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsInstockDetail> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getInstockDetailId() != null, WmsInstockDetail::getInstockDetailId, bo.getInstockDetailId());
lqw.eq(bo.getInstockId() != null, WmsInstockDetail::getInstockId, bo.getInstockId());
lqw.eq(StringUtils.isNotBlank(bo.getInstockCode()), WmsInstockDetail::getInstockCode, bo.getInstockCode());
lqw.eq(bo.getDnDId() != null, WmsInstockDetail::getDnDId, bo.getDnDId());
lqw.eq(bo.getPoDId() != null, WmsInstockDetail::getPoDId, bo.getPoDId());
lqw.eq(bo.getMaterialId() != null, WmsInstockDetail::getMaterialId, bo.getMaterialId());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCode()), WmsInstockDetail::getMaterialCode, bo.getMaterialCode());
lqw.like(StringUtils.isNotBlank(bo.getMaterialName()), WmsInstockDetail::getMaterialName, bo.getMaterialName());
lqw.eq(bo.getInstockQty() != null, WmsInstockDetail::getInstockQty, bo.getInstockQty());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialSpe()), WmsInstockDetail::getMaterialSpe, bo.getMaterialSpe());
lqw.like(StringUtils.isNotBlank(bo.getUnitName()), WmsInstockDetail::getUnitName, bo.getUnitName());
lqw.eq(StringUtils.isNotBlank(bo.getCodeYesNo()), WmsInstockDetail::getCodeYesNo, bo.getCodeYesNo());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsInstockDetail::getMaterialCategories, bo.getMaterialCategories());
return lqw;
}
/**
* -
*
* @param bo -
* @return
*/
@Override
public Boolean insertByBo(WmsInstockDetailBo bo) {
WmsInstockDetail add = MapstructUtils.convert(bo, WmsInstockDetail.class);
BaseMaterialInfoVo baseMaterialInfoVo = baseMaterialInfoService.queryById(bo.getMaterialId());
BeanUtils.copyProperties(baseMaterialInfoVo,add);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setInstockDetailId(add.getInstockDetailId());
}
return flag;
}
/**
* -
*
* @param bo -
* @return
*/
@Override
public Boolean updateByBo(WmsInstockDetailBo bo) {
if (bo.getPrintNum()==null){
WmsInstockDetail update = MapstructUtils.convert(bo, WmsInstockDetail.class);
validEntityBeforeSave(update);
return baseMapper.updateDetail(update)>0;
}
//打印数量不能超过入库数量
if (bo.getPrintNum()+bo.getPrintedNum()>bo.getInstockQty()){
return false;
}
Integer printNum = (int)wmsInstockPrintService.queryPrintNum(bo) + 1;
String order = generateOrder(printNum);
WmsInstockPrint wmsInstockPrint = new WmsInstockPrint();
BeanUtils.copyProperties(bo,wmsInstockPrint);
String instockCode = bo.getInstockCode();
String materialCode = bo.getMaterialCode();
String batchCode = instockCode+materialCode+order;
wmsInstockPrint.setBatchCode(batchCode);
wmsInstockPrint.setApportionQty(bo.getPrintNum().longValue());
wmsInstockPrint.setMaterialQty(bo.getBarcodeNum());
int rows = wmsInstockPrintService.insertWmsInstockPrint(wmsInstockPrint);
WmsInstockDetail wmsInstockDetail = new WmsInstockDetail();
wmsInstockDetail.setPrintedNum(bo.getPrintedNum()+bo.getPrintNum());
LambdaUpdateWrapper<WmsInstockDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(WmsInstockDetail::getInstockDetailId,bo.getInstockDetailId());
int update = baseMapper.update(wmsInstockDetail, updateWrapper);
return update>0;
}
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();
}
/**
*
*/
private void validEntityBeforeSave(WmsInstockDetail 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,203 @@
package org.dromara.wms.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
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;
import org.dromara.common.mybatis.core.page.PageQuery;
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.WmsBaseWarehouse;
import org.dromara.wms.domain.WmsConfiguration;
import org.dromara.wms.domain.WmsInstockOrder;
import org.dromara.wms.domain.bo.WmsConfigurationBo;
import org.dromara.wms.domain.bo.WmsInstockOrderBo;
import org.dromara.wms.domain.vo.WmsInstockOrderVo;
import org.dromara.wms.mapper.WmsInstockOrderMapper;
import org.dromara.wms.service.IWmsInstockOrderService;
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;
import java.util.concurrent.atomic.AtomicLong;
/**
* Service
*
* @author LionLi
* @date 2025-01-06
*/
@RequiredArgsConstructor
@Service
public class WmsInstockOrderServiceImpl implements IWmsInstockOrderService {
private static final AtomicInteger sequence = new AtomicInteger(999);
private final WmsInstockOrderMapper baseMapper;
public static Integer nextSequence() {
return sequence.incrementAndGet();
}
/**
*
*
* @param instockId
* @return
*/
@Override
public WmsInstockOrderVo queryById(Long instockId){
LambdaQueryWrapper<WmsInstockOrder> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(WmsInstockOrder::getInstockId,instockId);
return baseMapper.selectVoOne(wrapper);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<WmsInstockOrderVo> queryPageList(WmsInstockOrderBo bo, PageQuery pageQuery) {
// LambdaQueryWrapper<WmsInstockOrder> lqw = buildQueryWrapper(bo);
MPJLambdaWrapper<WmsInstockOrder> lqw = buildJoinQueryWrapper(bo);
lqw.orderByDesc(WmsInstockOrder::getCreateTime);
Page<WmsInstockOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsInstockOrderVo> queryList(WmsInstockOrderBo bo) {
LambdaQueryWrapper<WmsInstockOrder> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsInstockOrder> buildJoinQueryWrapper(WmsInstockOrderBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsInstockOrder> lqw = JoinWrappers.lambda(WmsInstockOrder.class)
.selectAll(WmsInstockOrder.class)
.select(WmsBaseWarehouse::getWarehouseCode)
.leftJoin(WmsBaseWarehouse.class, WmsBaseWarehouse::getWarehouseId, WmsInstockOrder::getWarehouseId);
lqw.eq(bo.getInstockId() != null, WmsInstockOrder::getInstockId, bo.getInstockId());
lqw.eq(StringUtils.isNotBlank(bo.getInstockCode()), WmsInstockOrder::getInstockCode, bo.getInstockCode());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsInstockOrder::getMaterialCategories, bo.getMaterialCategories());
lqw.eq(StringUtils.isNotBlank(bo.getInstockType()), WmsInstockOrder::getInstockType, bo.getInstockType());
lqw.eq(StringUtils.isNotBlank(bo.getOrderNo()), WmsInstockOrder::getOrderNo, bo.getOrderNo());
lqw.eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsInstockOrder::getAuditBy, bo.getAuditBy());
lqw.eq(bo.getAuditTime() != null, WmsInstockOrder::getAuditTime, bo.getAuditTime());
lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsInstockOrder::getAuditStatus, bo.getAuditStatus());
lqw.eq(StringUtils.isNotBlank(bo.getAuditComments()), WmsInstockOrder::getAuditComments, bo.getAuditComments());
lqw.eq(bo.getWarehouseId() != null, WmsInstockOrder::getWarehouseId, bo.getWarehouseId());
return lqw;
}
private LambdaQueryWrapper<WmsInstockOrder> buildQueryWrapper(WmsInstockOrderBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsInstockOrder> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getInstockId() != null, WmsInstockOrder::getInstockId, bo.getInstockId());
lqw.eq(StringUtils.isNotBlank(bo.getInstockCode()), WmsInstockOrder::getInstockCode, bo.getInstockCode());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsInstockOrder::getMaterialCategories, bo.getMaterialCategories());
lqw.eq(StringUtils.isNotBlank(bo.getInstockType()), WmsInstockOrder::getInstockType, bo.getInstockType());
lqw.eq(StringUtils.isNotBlank(bo.getOrderNo()), WmsInstockOrder::getOrderNo, bo.getOrderNo());
lqw.eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsInstockOrder::getAuditBy, bo.getAuditBy());
lqw.eq(bo.getAuditTime() != null, WmsInstockOrder::getAuditTime, bo.getAuditTime());
lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsInstockOrder::getAuditStatus, bo.getAuditStatus());
lqw.eq(StringUtils.isNotBlank(bo.getAuditComments()), WmsInstockOrder::getAuditComments, bo.getAuditComments());
lqw.eq(bo.getWarehouseId() != null, WmsInstockOrder::getWarehouseId, bo.getWarehouseId());
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(WmsInstockOrderBo bo) {
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHssmm");
String orderDate = format.format(date);
String order = "IN";
String orderLast="";
Integer value = nextSequence();
if (value.toString().length()==4){
sequence.set(1);
orderLast = generateOrder(sequence.get());
}else {
orderLast = generateOrder(value);
}
String inStockOrder = order + orderDate + orderLast;
WmsInstockOrder add = MapstructUtils.convert(bo, WmsInstockOrder.class);
validEntityBeforeSave(add);
add.setInstockCode(inStockOrder);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setInstockId(add.getInstockId());
}
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(WmsInstockOrderBo bo) {
WmsInstockOrder update = MapstructUtils.convert(bo, WmsInstockOrder.class);
validEntityBeforeSave(update);
// LambdaUpdateWrapper<WmsInstockOrder> wrapper = new LambdaUpdateWrapper<>();
// wrapper.eq(WmsInstockOrder::getInstockId,bo.getInstockId());
int rows = baseMapper.updateInstock(update);
return rows > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsInstockOrder entity){
//TODO 做一些数据校验,如唯一约束
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
LambdaUpdateWrapper<WmsInstockOrder> wrapper = new LambdaUpdateWrapper<>();
wrapper.in(WmsInstockOrder::getInstockId,ids);
return baseMapper.delete(wrapper)>0;
}
}

@ -0,0 +1,154 @@
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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.wms.domain.WmsInstockDetail;
import org.dromara.wms.domain.WmsInstockPrint;
import org.dromara.wms.domain.bo.WmsInstockDetailBo;
import org.dromara.wms.domain.bo.WmsInstockPrintBo;
import org.dromara.wms.domain.vo.WmsInstockPrintVo;
import org.dromara.wms.mapper.WmsInstockPrintMapper;
import org.dromara.wms.service.IWmsInstockPrintService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* -Service
*
* @author LionLi
* @date 2025-01-07
*/
@RequiredArgsConstructor
@Service
public class WmsInstockPrintServiceImpl implements IWmsInstockPrintService {
private final WmsInstockPrintMapper baseMapper;
/**
* -
*
* @param instockPrintId
* @return -
*/
@Override
public WmsInstockPrintVo queryById(Long instockPrintId){
return baseMapper.selectVoById(instockPrintId);
}
/**
* -
*
* @param bo
* @param pageQuery
* @return -
*/
@Override
public TableDataInfo<WmsInstockPrintVo> queryPageList(WmsInstockPrintBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<WmsInstockPrint> lqw = buildQueryWrapper(bo);
lqw.orderByDesc(WmsInstockPrint::getCreateTime);
Page<WmsInstockPrintVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* -
*
* @param bo
* @return -
*/
@Override
public List<WmsInstockPrintVo> queryList(WmsInstockPrintBo bo) {
LambdaQueryWrapper<WmsInstockPrint> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
public long queryPrintNum(WmsInstockDetailBo bo){
LambdaQueryWrapper<WmsInstockPrint> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(WmsInstockPrint::getInstockCode,bo.getInstockCode());
wrapper.eq(WmsInstockPrint::getMaterialCode,bo.getMaterialCode());
return baseMapper.selectCount(wrapper);
}
private LambdaQueryWrapper<WmsInstockPrint> buildQueryWrapper(WmsInstockPrintBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsInstockPrint> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getInstockPrintId() != null, WmsInstockPrint::getInstockPrintId, bo.getInstockPrintId());
lqw.eq(StringUtils.isNotBlank(bo.getInstockCode()), WmsInstockPrint::getInstockCode, bo.getInstockCode());
lqw.eq(StringUtils.isNotBlank(bo.getBatchCode()), WmsInstockPrint::getBatchCode, bo.getBatchCode());
lqw.eq(bo.getMaterialQty() != null, WmsInstockPrint::getMaterialQty, bo.getMaterialQty());
lqw.eq(bo.getApportionQty() != null, WmsInstockPrint::getApportionQty, bo.getApportionQty());
lqw.eq(bo.getMaterialId() != null, WmsInstockPrint::getMaterialId, bo.getMaterialId());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCode()), WmsInstockPrint::getMaterialCode, bo.getMaterialCode());
lqw.like(StringUtils.isNotBlank(bo.getMaterialName()), WmsInstockPrint::getMaterialName, bo.getMaterialName());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialSpe()), WmsInstockPrint::getMaterialSpe, bo.getMaterialSpe());
lqw.like(StringUtils.isNotBlank(bo.getUnitName()), WmsInstockPrint::getUnitName, bo.getUnitName());
lqw.eq(StringUtils.isNotBlank(bo.getCodeYesNo()), WmsInstockPrint::getCodeYesNo, bo.getCodeYesNo());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsInstockPrint::getMaterialCategories, bo.getMaterialCategories());
return lqw;
}
/**
* -
*
* @param bo -
* @return
*/
@Override
public Boolean insertByBo(WmsInstockPrintBo bo) {
WmsInstockPrint add = MapstructUtils.convert(bo, WmsInstockPrint.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setInstockPrintId(add.getInstockPrintId());
}
return flag;
}
public int insertWmsInstockPrint(WmsInstockPrint wmsInstockPrint){
return baseMapper.insert(wmsInstockPrint);
}
/**
* -
*
* @param bo -
* @return
*/
@Override
public Boolean updateByBo(WmsInstockPrintBo bo) {
WmsInstockPrint update = MapstructUtils.convert(bo, WmsInstockPrint.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsInstockPrint 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,168 @@
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;
import org.dromara.common.mybatis.core.page.PageQuery;
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.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.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.stream.Collectors;
/**
* Service
*
* @author LionLi
* @date 2025-01-07
*/
@RequiredArgsConstructor
@Service
public class WmsInventoryServiceImpl implements IWmsInventoryService {
private final WmsInventoryMapper baseMapper;
/**
*
*
* @param inventoryId
* @return
*/
@Override
public WmsInventoryVo queryById(Long inventoryId){
return baseMapper.selectVoById(inventoryId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<WmsInventoryVo> queryPageList(WmsInventoryBo bo, PageQuery pageQuery) {
// LambdaQueryWrapper<WmsInventory> lqw = buildQueryWrapper(bo);
MPJLambdaWrapper<WmsInventory> lqw = buildJoinQueryWrapper(bo);
lqw.orderByDesc(WmsInventory::getCreateTime);
Page<WmsInventoryVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsInventoryVo> queryList(WmsInventoryBo bo) {
LambdaQueryWrapper<WmsInventory> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<WmsInventory> buildQueryWrapper(WmsInventoryBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsInventory> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getInventoryId() != null, WmsInventory::getInventoryId, bo.getInventoryId());
lqw.eq(StringUtils.isNotBlank(bo.getBatchCode()), WmsInventory::getBatchCode, bo.getBatchCode());
lqw.eq(bo.getMaterialId() != null, WmsInventory::getMaterialId, bo.getMaterialId());
lqw.eq(StringUtils.isNotBlank(bo.getLocationCode()), WmsInventory::getLocationCode, bo.getLocationCode());
lqw.eq(bo.getMaterialCategories() != null, WmsInventory::getMaterialCategories, bo.getMaterialCategories());
lqw.eq(bo.getInventoryQty() != null, WmsInventory::getInventoryQty, bo.getInventoryQty());
lqw.eq(StringUtils.isNotBlank(bo.getLockState()), WmsInventory::getLockState, bo.getLockState());
lqw.eq(StringUtils.isNotBlank(bo.getInventoryStatus()), WmsInventory::getInventoryStatus, bo.getInventoryStatus());
lqw.eq(bo.getStoreId() != null, WmsInventory::getStoreId, bo.getStoreId());
return lqw;
}
private MPJLambdaWrapper<WmsInventory> buildJoinQueryWrapper(WmsInventoryBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsInventory> lqw = JoinWrappers.lambda(WmsInventory.class)
.selectAll(WmsInventory.class)
.select(WmsBaseWarehouse::getWarehouseCode)
.leftJoin(WmsBaseWarehouse.class, WmsBaseWarehouse::getWarehouseId, WmsInventory::getStoreId);
lqw.eq(bo.getInventoryId() != null, WmsInventory::getInventoryId, bo.getInventoryId());
lqw.eq(StringUtils.isNotBlank(bo.getBatchCode()), WmsInventory::getBatchCode, bo.getBatchCode());
lqw.eq(bo.getMaterialId() != null, WmsInventory::getMaterialId, bo.getMaterialId());
lqw.eq(StringUtils.isNotBlank(bo.getLocationCode()), WmsInventory::getLocationCode, bo.getLocationCode());
lqw.eq(bo.getMaterialCategories() != null, WmsInventory::getMaterialCategories, bo.getMaterialCategories());
lqw.eq(bo.getInventoryQty() != null, WmsInventory::getInventoryQty, bo.getInventoryQty());
lqw.eq(StringUtils.isNotBlank(bo.getLockState()), WmsInventory::getLockState, bo.getLockState());
lqw.eq(StringUtils.isNotBlank(bo.getInventoryStatus()), WmsInventory::getInventoryStatus, bo.getInventoryStatus());
lqw.eq(bo.getStoreId() != null, WmsInventory::getStoreId, bo.getStoreId());
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(WmsInventoryBo bo) {
WmsInventory add = MapstructUtils.convert(bo, WmsInventory.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setInventoryId(add.getInventoryId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(WmsInventoryBo bo) {
WmsInventory update = MapstructUtils.convert(bo, WmsInventory.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsInventory entity){
//TODO 做一些数据校验,如唯一约束
}
@Override
public BigDecimal materailCount(WmsInventory wmsInventory) {
return baseMapper.materailCount(wmsInventory);
}
/**
*
*
* @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,154 @@
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;
import org.dromara.common.mybatis.core.page.PageQuery;
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.WmsInventory;
import org.dromara.wms.domain.WmsOutstockDetail;
import org.dromara.wms.domain.bo.WmsOutstockDetailBo;
import org.dromara.wms.domain.vo.WmsOutstockDetailVo;
import org.dromara.wms.mapper.WmsOutstockDetailMapper;
import org.dromara.wms.service.IWmsOutstockDetailService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* -Service
*
* @author LionLi
* @date 2025-01-08
*/
@RequiredArgsConstructor
@Service
public class WmsOutstockDetailServiceImpl implements IWmsOutstockDetailService {
private final WmsOutstockDetailMapper baseMapper;
/**
* -
*
* @param outstockDetailId
* @return -
*/
@Override
public WmsOutstockDetailVo queryById(Long outstockDetailId){
return baseMapper.selectVoById(outstockDetailId);
}
/**
* -
*
* @param bo
* @param pageQuery
* @return -
*/
@Override
public TableDataInfo<WmsOutstockDetailVo> queryPageList(WmsOutstockDetailBo bo, PageQuery pageQuery) {
// LambdaQueryWrapper<WmsOutstockDetail> lqw = buildQueryWrapper(bo);
MPJLambdaWrapper<WmsOutstockDetail> mpjLambdaWrapper = buildJoinQueryWrapper(bo);
Page<WmsOutstockDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), mpjLambdaWrapper);
return TableDataInfo.build(result);
}
/**
* -
*
* @param bo
* @return -
*/
@Override
public List<WmsOutstockDetailVo> queryList(WmsOutstockDetailBo bo) {
LambdaQueryWrapper<WmsOutstockDetail> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<WmsOutstockDetail> buildQueryWrapper(WmsOutstockDetailBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsOutstockDetail> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getOutstockDetailId() != null, WmsOutstockDetail::getOutstockDetailId, bo.getOutstockDetailId());
lqw.eq(StringUtils.isNotBlank(bo.getOutstockCode()), WmsOutstockDetail::getOutstockCode, bo.getOutstockCode());
lqw.eq(bo.getOutstockId() != null, WmsOutstockDetail::getOutstockId, bo.getOutstockId());
lqw.eq(bo.getMaterialId() != null, WmsOutstockDetail::getMaterialId, bo.getMaterialId());
lqw.eq(bo.getOutstockQty() != null, WmsOutstockDetail::getOutstockQty, bo.getOutstockQty());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsOutstockDetail::getMaterialCategories, bo.getMaterialCategories());
return lqw;
}
private MPJLambdaWrapper<WmsOutstockDetail> buildJoinQueryWrapper(WmsOutstockDetailBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsOutstockDetail> lqw = JoinWrappers.lambda(WmsOutstockDetail.class)
.selectAll(WmsOutstockDetail.class)
.select(BaseMaterialInfo::getMaterialCode)
.leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, WmsOutstockDetail::getMaterialId)
.eq(bo.getOutstockDetailId() != null, WmsOutstockDetail::getOutstockDetailId, bo.getOutstockDetailId())
.eq(StringUtils.isNotBlank(bo.getOutstockCode()), WmsOutstockDetail::getOutstockCode, bo.getOutstockCode())
.eq(bo.getOutstockId() != null, WmsOutstockDetail::getOutstockId, bo.getOutstockId())
.eq(bo.getMaterialId() != null, WmsOutstockDetail::getMaterialId, bo.getMaterialId())
.eq(bo.getOutstockQty() != null, WmsOutstockDetail::getOutstockQty, bo.getOutstockQty())
.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsOutstockDetail::getMaterialCategories, bo.getMaterialCategories())
.orderByAsc(WmsOutstockDetail::getCreateTime);
return lqw;
}
/**
* -
*
* @param bo -
* @return
*/
@Override
public Boolean insertByBo(WmsOutstockDetailBo bo) {
WmsOutstockDetail add = MapstructUtils.convert(bo, WmsOutstockDetail.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setOutstockDetailId(add.getOutstockDetailId());
}
return flag;
}
/**
* -
*
* @param bo -
* @return
*/
@Override
public Boolean updateByBo(WmsOutstockDetailBo bo) {
WmsOutstockDetail update = MapstructUtils.convert(bo, WmsOutstockDetail.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsOutstockDetail 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,171 @@
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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.wms.domain.WmsOutstockOrder;
import org.dromara.wms.domain.bo.WmsOutstockOrderBo;
import org.dromara.wms.domain.vo.WmsOutstockOrderVo;
import org.dromara.wms.mapper.WmsInstockOrderMapper;
import org.dromara.wms.mapper.WmsOutstockOrderMapper;
import org.dromara.wms.service.IWmsOutstockOrderService;
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-08
*/
@RequiredArgsConstructor
@Service
public class WmsOutstockOrderServiceImpl implements IWmsOutstockOrderService {
private final WmsOutstockOrderMapper baseMapper;
private static final AtomicInteger sequence = new AtomicInteger(999);
public static Integer nextSequence() {
return sequence.incrementAndGet();
}
/**
*
*
* @param outstockId
* @return
*/
@Override
public WmsOutstockOrderVo queryById(Long outstockId){
return baseMapper.selectVoById(outstockId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<WmsOutstockOrderVo> queryPageList(WmsOutstockOrderBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<WmsOutstockOrder> lqw = buildQueryWrapper(bo);
lqw.orderByDesc(WmsOutstockOrder::getCreateTime);
Page<WmsOutstockOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsOutstockOrderVo> queryList(WmsOutstockOrderBo bo) {
LambdaQueryWrapper<WmsOutstockOrder> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<WmsOutstockOrder> buildQueryWrapper(WmsOutstockOrderBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsOutstockOrder> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getOutstockId() != null, WmsOutstockOrder::getOutstockId, bo.getOutstockId());
lqw.eq(bo.getWarehouseId() != null, WmsOutstockOrder::getWarehouseId, bo.getWarehouseId());
lqw.eq(StringUtils.isNotBlank(bo.getOutstockCode()), WmsOutstockOrder::getOutstockCode, bo.getOutstockCode());
lqw.eq(StringUtils.isNotBlank(bo.getOutstockType()), WmsOutstockOrder::getOutstockType, bo.getOutstockType());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsOutstockOrder::getMaterialCategories, bo.getMaterialCategories());
lqw.eq(StringUtils.isNotBlank(bo.getOrderType()), WmsOutstockOrder::getOrderType, bo.getOrderType());
lqw.eq(StringUtils.isNotBlank(bo.getOrderNo()), WmsOutstockOrder::getOrderNo, bo.getOrderNo());
lqw.eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsOutstockOrder::getAuditBy, bo.getAuditBy());
lqw.eq(bo.getAuditTime() != null, WmsOutstockOrder::getAuditTime, bo.getAuditTime());
lqw.eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsOutstockOrder::getAuditStatus, bo.getAuditStatus());
lqw.eq(StringUtils.isNotBlank(bo.getAuditComments()), WmsOutstockOrder::getAuditComments, bo.getAuditComments());
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(WmsOutstockOrderBo bo) {
Date date = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHssmm");
String orderDate = format.format(date);
String order = "OU";
String orderLast="";
Integer value = nextSequence();
if (value.toString().length()==4){
sequence.set(1);
orderLast = generateOrder(sequence.get());
}else {
orderLast = generateOrder(value);
}
String outStockOrder = order + orderDate + orderLast;
WmsOutstockOrder add = MapstructUtils.convert(bo, WmsOutstockOrder.class);
validEntityBeforeSave(add);
add.setOutstockCode(outStockOrder);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setOutstockId(add.getOutstockId());
}
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(WmsOutstockOrderBo bo) {
WmsOutstockOrder update = MapstructUtils.convert(bo, WmsOutstockOrder.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsOutstockOrder 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,145 @@
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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.wms.domain.WmsReturnOrder;
import org.dromara.wms.domain.bo.WmsReturnOrderBo;
import org.dromara.wms.domain.vo.WmsReturnOrderVo;
import org.dromara.wms.mapper.WmsReturnOrderMapper;
import org.dromara.wms.service.IWmsReturnOrderService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 退Service
*
* @author LionLi
* @date 2025-01-09
*/
@RequiredArgsConstructor
@Service
public class WmsReturnOrderServiceImpl implements IWmsReturnOrderService {
private final WmsReturnOrderMapper baseMapper;
/**
* 退
*
* @param roId
* @return 退
*/
@Override
public WmsReturnOrderVo queryById(Long roId){
return baseMapper.selectVoById(roId);
}
/**
* 退
*
* @param bo
* @param pageQuery
* @return 退
*/
@Override
public TableDataInfo<WmsReturnOrderVo> queryPageList(WmsReturnOrderBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<WmsReturnOrder> lqw = buildQueryWrapper(bo);
lqw.orderByDesc(WmsReturnOrder::getCreateTime);
Page<WmsReturnOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 退
*
* @param bo
* @return 退
*/
@Override
public List<WmsReturnOrderVo> queryList(WmsReturnOrderBo bo) {
LambdaQueryWrapper<WmsReturnOrder> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<WmsReturnOrder> buildQueryWrapper(WmsReturnOrderBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<WmsReturnOrder> lqw = Wrappers.lambdaQuery();
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());
return lqw;
}
/**
* 退
*
* @param bo 退
* @return
*/
@Override
public Boolean insertByBo(WmsReturnOrderBo bo) {
WmsReturnOrder add = MapstructUtils.convert(bo, WmsReturnOrder.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setRoId(add.getRoId());
}
return flag;
}
/**
* 退
*
* @param bo 退
* @return
*/
@Override
public Boolean updateByBo(WmsReturnOrderBo bo) {
WmsReturnOrder update = MapstructUtils.convert(bo, WmsReturnOrder.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsReturnOrder entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 退
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -23,6 +23,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
VALUES (#{entity.nodeCode},(#{entity.nodeName},(#{entity.approveYesNo},(#{entity.approveType},(#{entity.approveRoleCode},(#{entity.warehouseId},(#{entity.approveRange},(#{entity.tenantId},
(#{entity.createBy},(#{entity.createTime},(#{entity.updateBy},(#{entity.updateTime})
</insert>
<update id="updateByconfigurationId" parameterType="org.dromara.wms.domain.WmsConfiguration">
update wms_configuration
<trim prefix="SET" suffixOverrides=",">
<if test="nodeCode != null">node_code = #{nodeCode},</if>
<if test="nodeName != null and nodeName != ''">node_name = #{nodeName},</if>
<if test="approveYesNo != null and approveYesNo != ''">approve_yes_no = #{approveYesNo},</if>
<if test="approveType != null">approve_type = #{approveType},</if>
<if test="approveRoleCode != null">approve_role_code = #{approveRoleCode},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="approveRange != null">approve_range = #{approveRange},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where configuration_id = #{configurationId}
</update>
<select id="selectNum" resultType="java.lang.Integer">
select count(1) from wms_configuration
</select>

@ -0,0 +1,22 @@
<?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.WmsInstockDetailMapper">
<update id="updateDetail" parameterType="org.dromara.wms.domain.WmsInstockDetail">
update wms_instock_detail
<trim prefix="SET" suffixOverrides=",">
<if test="dnDId != null">dn_d_id = #{dnDId},</if>
<if test="poDId != null and poDId != ''">po_d_id = #{poDId},</if>
<if test="materialId != null and materialId != ''">material_id = #{materialId},</if>
<if test="instockQty != null">instock_qty = #{instockQty},</if>
<if test="codeYesNo != null">code_yes_no = #{codeYesNo},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where instock_id = #{instockId}
</update>
</mapper>

@ -0,0 +1,23 @@
<?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.WmsInstockOrderMapper">
<update id="updateInstock" parameterType="org.dromara.wms.domain.WmsInstockOrder">
update wms_instock_order
<trim prefix="SET" suffixOverrides=",">
<if test="instockCode != null">instock_code = #{instockCode},</if>
<if test="materialCategories != null and materialCategories != ''">material_categories = #{materialCategories},</if>
<if test="instockType != null and instockType != ''">instock_type = #{instockType},</if>
<if test="auditBy != null">audit_by = #{auditBy},</if>
<if test="auditComments != null">audit_comments = #{auditComments},</if>
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where instock_id = #{instockId}
</update>
</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.WmsInstockPrintMapper">
</mapper>

@ -0,0 +1,16 @@
<?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.WmsInventoryMapper">
<select id="materailCount" resultType="java.math.BigDecimal"
parameterType="org.dromara.wms.domain.WmsInventory">
SELECT
ISNULL(SUM(x.inventory_qty),0)
FROM
hwmom.dbo.wms_inventory x
where
x.material_id = #{entity.materialId}
</select>
</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.WmsOutstockDetailMapper">
</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.WmsOutstockOrderMapper">
</mapper>
Loading…
Cancel
Save