feat(wms): 新增发货计划、发货单主表及明细表功能模块

- 新增发货计划实体类、业务对象、控制器、服务接口及实现
- 新增发货单主表实体类、业务对象、控制器、服务接口及实现
- 新增发货单明细表实体类、业务对象、控制器、服务接口及实现
- 配置相关Mapper接口与XML映射文件
- 实现基础的增删改查及分页查询功能
- 支持Excel导出功能
- 添加基础数据校验与日志记录
This commit is contained in:
2025-11-25 15:44:19 +08:00
parent 5d4eac555a
commit 97680263f1
24 changed files with 1696 additions and 0 deletions

View File

@@ -0,0 +1,99 @@
package com.klp.controller;
import java.util.List;
import java.util.Arrays;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.klp.common.annotation.RepeatSubmit;
import com.klp.common.annotation.Log;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.domain.R;
import com.klp.common.core.validate.AddGroup;
import com.klp.common.core.validate.EditGroup;
import com.klp.common.enums.BusinessType;
import com.klp.common.utils.poi.ExcelUtil;
import com.klp.domain.vo.WmsDeliveryPlanVo;
import com.klp.domain.bo.WmsDeliveryPlanBo;
import com.klp.service.IWmsDeliveryPlanService;
import com.klp.common.core.page.TableDataInfo;
/**
* 发货计划
*
* @author klp
* @date 2025-11-25
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/wms/deliveryPlan")
public class WmsDeliveryPlanController extends BaseController {
private final IWmsDeliveryPlanService iWmsDeliveryPlanService;
/**
* 查询发货计划列表
*/
@GetMapping("/list")
public TableDataInfo<WmsDeliveryPlanVo> list(WmsDeliveryPlanBo bo, PageQuery pageQuery) {
return iWmsDeliveryPlanService.queryPageList(bo, pageQuery);
}
/**
* 导出发货计划列表
*/
@Log(title = "发货计划", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsDeliveryPlanBo bo, HttpServletResponse response) {
List<WmsDeliveryPlanVo> list = iWmsDeliveryPlanService.queryList(bo);
ExcelUtil.exportExcel(list, "发货计划", WmsDeliveryPlanVo.class, response);
}
/**
* 获取发货计划详细信息
*
* @param planId 主键
*/
@GetMapping("/{planId}")
public R<WmsDeliveryPlanVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long planId) {
return R.ok(iWmsDeliveryPlanService.queryById(planId));
}
/**
* 新增发货计划
*/
@Log(title = "发货计划", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsDeliveryPlanBo bo) {
return toAjax(iWmsDeliveryPlanService.insertByBo(bo));
}
/**
* 修改发货计划
*/
@Log(title = "发货计划", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsDeliveryPlanBo bo) {
return toAjax(iWmsDeliveryPlanService.updateByBo(bo));
}
/**
* 删除发货计划
*
* @param planIds 主键串
*/
@Log(title = "发货计划", businessType = BusinessType.DELETE)
@DeleteMapping("/{planIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] planIds) {
return toAjax(iWmsDeliveryPlanService.deleteWithValidByIds(Arrays.asList(planIds), true));
}
}

View File

@@ -0,0 +1,99 @@
package com.klp.controller;
import java.util.List;
import java.util.Arrays;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.klp.common.annotation.RepeatSubmit;
import com.klp.common.annotation.Log;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.domain.R;
import com.klp.common.core.validate.AddGroup;
import com.klp.common.core.validate.EditGroup;
import com.klp.common.enums.BusinessType;
import com.klp.common.utils.poi.ExcelUtil;
import com.klp.domain.vo.WmsDeliveryWaybillVo;
import com.klp.domain.bo.WmsDeliveryWaybillBo;
import com.klp.service.IWmsDeliveryWaybillService;
import com.klp.common.core.page.TableDataInfo;
/**
* 发货单主
*
* @author klp
* @date 2025-11-25
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/wms/deliveryWaybill")
public class WmsDeliveryWaybillController extends BaseController {
private final IWmsDeliveryWaybillService iWmsDeliveryWaybillService;
/**
* 查询发货单主列表
*/
@GetMapping("/list")
public TableDataInfo<WmsDeliveryWaybillVo> list(WmsDeliveryWaybillBo bo, PageQuery pageQuery) {
return iWmsDeliveryWaybillService.queryPageList(bo, pageQuery);
}
/**
* 导出发货单主列表
*/
@Log(title = "发货单主", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsDeliveryWaybillBo bo, HttpServletResponse response) {
List<WmsDeliveryWaybillVo> list = iWmsDeliveryWaybillService.queryList(bo);
ExcelUtil.exportExcel(list, "发货单主", WmsDeliveryWaybillVo.class, response);
}
/**
* 获取发货单主详细信息
*
* @param waybillId 主键
*/
@GetMapping("/{waybillId}")
public R<WmsDeliveryWaybillVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long waybillId) {
return R.ok(iWmsDeliveryWaybillService.queryById(waybillId));
}
/**
* 新增发货单主
*/
@Log(title = "发货单主", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsDeliveryWaybillBo bo) {
return toAjax(iWmsDeliveryWaybillService.insertByBo(bo));
}
/**
* 修改发货单主
*/
@Log(title = "发货单主", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsDeliveryWaybillBo bo) {
return toAjax(iWmsDeliveryWaybillService.updateByBo(bo));
}
/**
* 删除发货单主
*
* @param waybillIds 主键串
*/
@Log(title = "发货单主", businessType = BusinessType.DELETE)
@DeleteMapping("/{waybillIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] waybillIds) {
return toAjax(iWmsDeliveryWaybillService.deleteWithValidByIds(Arrays.asList(waybillIds), true));
}
}

View File

@@ -0,0 +1,99 @@
package com.klp.controller;
import java.util.List;
import java.util.Arrays;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.klp.common.annotation.RepeatSubmit;
import com.klp.common.annotation.Log;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.domain.R;
import com.klp.common.core.validate.AddGroup;
import com.klp.common.core.validate.EditGroup;
import com.klp.common.enums.BusinessType;
import com.klp.common.utils.poi.ExcelUtil;
import com.klp.domain.vo.WmsDeliveryWaybillDetailVo;
import com.klp.domain.bo.WmsDeliveryWaybillDetailBo;
import com.klp.service.IWmsDeliveryWaybillDetailService;
import com.klp.common.core.page.TableDataInfo;
/**
* 发货单明细
*
* @author klp
* @date 2025-11-25
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/wms/deliveryWaybillDetail")
public class WmsDeliveryWaybillDetailController extends BaseController {
private final IWmsDeliveryWaybillDetailService iWmsDeliveryWaybillDetailService;
/**
* 查询发货单明细列表
*/
@GetMapping("/list")
public TableDataInfo<WmsDeliveryWaybillDetailVo> list(WmsDeliveryWaybillDetailBo bo, PageQuery pageQuery) {
return iWmsDeliveryWaybillDetailService.queryPageList(bo, pageQuery);
}
/**
* 导出发货单明细列表
*/
@Log(title = "发货单明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsDeliveryWaybillDetailBo bo, HttpServletResponse response) {
List<WmsDeliveryWaybillDetailVo> list = iWmsDeliveryWaybillDetailService.queryList(bo);
ExcelUtil.exportExcel(list, "发货单明细", WmsDeliveryWaybillDetailVo.class, response);
}
/**
* 获取发货单明细详细信息
*
* @param detailId 主键
*/
@GetMapping("/{detailId}")
public R<WmsDeliveryWaybillDetailVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long detailId) {
return R.ok(iWmsDeliveryWaybillDetailService.queryById(detailId));
}
/**
* 新增发货单明细
*/
@Log(title = "发货单明细", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsDeliveryWaybillDetailBo bo) {
return toAjax(iWmsDeliveryWaybillDetailService.insertByBo(bo));
}
/**
* 修改发货单明细
*/
@Log(title = "发货单明细", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsDeliveryWaybillDetailBo bo) {
return toAjax(iWmsDeliveryWaybillDetailService.updateByBo(bo));
}
/**
* 删除发货单明细
*
* @param detailIds 主键串
*/
@Log(title = "发货单明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{detailIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] detailIds) {
return toAjax(iWmsDeliveryWaybillDetailService.deleteWithValidByIds(Arrays.asList(detailIds), true));
}
}