feat(wms): 添加应收货物计划管理功能
- 创建应收货物计划实体类 WmsReceivePlan - 定义应收货物计划服务接口 IWmsReceivePlanService - 实现应收货物计划服务业务逻辑 WmsReceivePlanServiceImpl - 创建应收货物计划控制器 WmsReceivePlanController - 设计应收货物计划数据传输对象 WmsReceivePlanBo 和视图对象 WmsReceivePlanVo - 配置应收货物计划数据访问映射 WmsReceivePlanMapper - 添加应收货物计划数据库映射文件 - 实现应收货物计划的增删改查功能 - 集成分页查询和导出功能
This commit is contained in:
@@ -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.WmsReceivePlanVo;
|
||||||
|
import com.klp.domain.bo.WmsReceivePlanBo;
|
||||||
|
import com.klp.service.IWmsReceivePlanService;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收货物计划
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-10
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/wms/receivePlan")
|
||||||
|
public class WmsReceivePlanController extends BaseController {
|
||||||
|
|
||||||
|
private final IWmsReceivePlanService iWmsReceivePlanService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询应收货物计划列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<WmsReceivePlanVo> list(WmsReceivePlanBo bo, PageQuery pageQuery) {
|
||||||
|
return iWmsReceivePlanService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出应收货物计划列表
|
||||||
|
*/
|
||||||
|
@Log(title = "应收货物计划", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(WmsReceivePlanBo bo, HttpServletResponse response) {
|
||||||
|
List<WmsReceivePlanVo> list = iWmsReceivePlanService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "应收货物计划", WmsReceivePlanVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取应收货物计划详细信息
|
||||||
|
*
|
||||||
|
* @param receiveId 主键
|
||||||
|
*/
|
||||||
|
@GetMapping("/{receiveId}")
|
||||||
|
public R<WmsReceivePlanVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long receiveId) {
|
||||||
|
return R.ok(iWmsReceivePlanService.queryById(receiveId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增应收货物计划
|
||||||
|
*/
|
||||||
|
@Log(title = "应收货物计划", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Long> add(@Validated(AddGroup.class) @RequestBody WmsReceivePlanBo bo) {
|
||||||
|
return R.ok(iWmsReceivePlanService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改应收货物计划
|
||||||
|
*/
|
||||||
|
@Log(title = "应收货物计划", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsReceivePlanBo bo) {
|
||||||
|
return toAjax(iWmsReceivePlanService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除应收货物计划
|
||||||
|
*
|
||||||
|
* @param receiveIds 主键串
|
||||||
|
*/
|
||||||
|
@Log(title = "应收货物计划", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{receiveIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] receiveIds) {
|
||||||
|
return toAjax(iWmsReceivePlanService.deleteWithValidByIds(Arrays.asList(receiveIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
116
klp-wms/src/main/java/com/klp/domain/WmsReceivePlan.java
Normal file
116
klp-wms/src/main/java/com/klp/domain/WmsReceivePlan.java
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
package com.klp.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收货物计划对象 wms_receive_plan
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("wms_receive_plan")
|
||||||
|
public class WmsReceivePlan extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "receive_id")
|
||||||
|
private Long receiveId;
|
||||||
|
/**
|
||||||
|
* 绑定应收计划ID(收货对照关联用)
|
||||||
|
*/
|
||||||
|
private Long planId;
|
||||||
|
/**
|
||||||
|
* 逻辑库区
|
||||||
|
*/
|
||||||
|
private String warehouseArea;
|
||||||
|
/**
|
||||||
|
* 入场卷号
|
||||||
|
*/
|
||||||
|
private String lotNo;
|
||||||
|
/**
|
||||||
|
* 厂家卷号
|
||||||
|
*/
|
||||||
|
private String supplierLotNo;
|
||||||
|
/**
|
||||||
|
* 成品卷号
|
||||||
|
*/
|
||||||
|
private String productLotNo;
|
||||||
|
/**
|
||||||
|
* 生产/发货日期
|
||||||
|
*/
|
||||||
|
private Date productionDate;
|
||||||
|
/**
|
||||||
|
* 重量(kg)
|
||||||
|
*/
|
||||||
|
private BigDecimal weight;
|
||||||
|
/**
|
||||||
|
* 收货状态(0待收货 1已收货 2异常)
|
||||||
|
*/
|
||||||
|
private String receiveStatus;
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
/**
|
||||||
|
* 规格(如厚度*宽度)
|
||||||
|
*/
|
||||||
|
private String spec;
|
||||||
|
/**
|
||||||
|
* 长度(mm)
|
||||||
|
*/
|
||||||
|
private BigDecimal length;
|
||||||
|
/**
|
||||||
|
* 材质
|
||||||
|
*/
|
||||||
|
private String materialType;
|
||||||
|
/**
|
||||||
|
* 生产厂家
|
||||||
|
*/
|
||||||
|
private String manufacturer;
|
||||||
|
/**
|
||||||
|
* 表面处理工艺
|
||||||
|
*/
|
||||||
|
private String surfaceTreatment;
|
||||||
|
/**
|
||||||
|
* 锌层(g/m²)
|
||||||
|
*/
|
||||||
|
private String zincCoating;
|
||||||
|
/**
|
||||||
|
* 班组
|
||||||
|
*/
|
||||||
|
private String teamGroup;
|
||||||
|
/**
|
||||||
|
* 调制度
|
||||||
|
*/
|
||||||
|
private String temperRolling;
|
||||||
|
/**
|
||||||
|
* 镀层种类
|
||||||
|
*/
|
||||||
|
private String coatingType;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String goodsType;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 删除标记(0正常 1删除)
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Long delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
129
klp-wms/src/main/java/com/klp/domain/bo/WmsReceivePlanBo.java
Normal file
129
klp-wms/src/main/java/com/klp/domain/bo/WmsReceivePlanBo.java
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
package com.klp.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收货物计划业务对象 wms_receive_plan
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-10
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class WmsReceivePlanBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
private Long receiveId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定应收计划ID(收货对照关联用)
|
||||||
|
*/
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑库区
|
||||||
|
*/
|
||||||
|
private String warehouseArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入场卷号
|
||||||
|
*/
|
||||||
|
private String lotNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 厂家卷号
|
||||||
|
*/
|
||||||
|
private String supplierLotNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成品卷号
|
||||||
|
*/
|
||||||
|
private String productLotNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产/发货日期
|
||||||
|
*/
|
||||||
|
private Date productionDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重量(kg)
|
||||||
|
*/
|
||||||
|
private BigDecimal weight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货状态(0待收货 1已收货 2异常)
|
||||||
|
*/
|
||||||
|
private String receiveStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格(如厚度*宽度)
|
||||||
|
*/
|
||||||
|
private String spec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长度(mm)
|
||||||
|
*/
|
||||||
|
private BigDecimal length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 材质
|
||||||
|
*/
|
||||||
|
private String materialType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产厂家
|
||||||
|
*/
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表面处理工艺
|
||||||
|
*/
|
||||||
|
private String surfaceTreatment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 锌层(g/m²)
|
||||||
|
*/
|
||||||
|
private String zincCoating;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组
|
||||||
|
*/
|
||||||
|
private String teamGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调制度
|
||||||
|
*/
|
||||||
|
private String temperRolling;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 镀层种类
|
||||||
|
*/
|
||||||
|
private String coatingType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private String goodsType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
158
klp-wms/src/main/java/com/klp/domain/vo/WmsReceivePlanVo.java
Normal file
158
klp-wms/src/main/java/com/klp/domain/vo/WmsReceivePlanVo.java
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
package com.klp.domain.vo;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.klp.common.annotation.ExcelDictFormat;
|
||||||
|
import com.klp.common.convert.ExcelDictConvert;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收货物计划视图对象 wms_receive_plan
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WmsReceivePlanVo extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "主键ID")
|
||||||
|
private Long receiveId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定应收计划ID(收货对照关联用)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "绑定应收计划ID(收货对照关联用)")
|
||||||
|
private Long planId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑库区
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "逻辑库区")
|
||||||
|
private String warehouseArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入场卷号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "入场卷号")
|
||||||
|
private String lotNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 厂家卷号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "厂家卷号")
|
||||||
|
private String supplierLotNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成品卷号
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "成品卷号")
|
||||||
|
private String productLotNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产/发货日期
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "生产/发货日期")
|
||||||
|
private Date productionDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重量(kg)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "重量", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "k=g")
|
||||||
|
private BigDecimal weight;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货状态(0待收货 1已收货 2异常)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "收货状态", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "0=待收货,1=已收货,2=异常")
|
||||||
|
private String receiveStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "名称")
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格(如厚度*宽度)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "规格", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "如=厚度*宽度")
|
||||||
|
private String spec;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长度(mm)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "长度", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "m=m")
|
||||||
|
private BigDecimal length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 材质
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "材质")
|
||||||
|
private String materialType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生产厂家
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "生产厂家")
|
||||||
|
private String manufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表面处理工艺
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "表面处理工艺")
|
||||||
|
private String surfaceTreatment;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 锌层(g/m²)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "锌层", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "g=/m²")
|
||||||
|
private String zincCoating;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 班组
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "班组")
|
||||||
|
private String teamGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调制度
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "调制度")
|
||||||
|
private String temperRolling;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 镀层种类
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "镀层种类")
|
||||||
|
private String coatingType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "类型")
|
||||||
|
private String goodsType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.klp.mapper;
|
||||||
|
|
||||||
|
import com.klp.domain.WmsReceivePlan;
|
||||||
|
import com.klp.domain.vo.WmsReceivePlanVo;
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收货物计划Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-10
|
||||||
|
*/
|
||||||
|
public interface WmsReceivePlanMapper extends BaseMapperPlus<WmsReceivePlanMapper, WmsReceivePlan, WmsReceivePlanVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.klp.service;
|
||||||
|
|
||||||
|
import com.klp.domain.WmsReceivePlan;
|
||||||
|
import com.klp.domain.vo.WmsReceivePlanVo;
|
||||||
|
import com.klp.domain.bo.WmsReceivePlanBo;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收货物计划Service接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-10
|
||||||
|
*/
|
||||||
|
public interface IWmsReceivePlanService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询应收货物计划
|
||||||
|
*/
|
||||||
|
WmsReceivePlanVo queryById(Long receiveId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询应收货物计划列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<WmsReceivePlanVo> queryPageList(WmsReceivePlanBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询应收货物计划列表
|
||||||
|
*/
|
||||||
|
List<WmsReceivePlanVo> queryList(WmsReceivePlanBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增应收货物计划
|
||||||
|
*/
|
||||||
|
Long insertByBo(WmsReceivePlanBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改应收货物计划
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(WmsReceivePlanBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除应收货物计划信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package com.klp.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
import com.klp.common.core.domain.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 com.klp.common.utils.StringUtils;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.klp.domain.bo.WmsReceivePlanBo;
|
||||||
|
import com.klp.domain.vo.WmsReceivePlanVo;
|
||||||
|
import com.klp.domain.WmsReceivePlan;
|
||||||
|
import com.klp.mapper.WmsReceivePlanMapper;
|
||||||
|
import com.klp.service.IWmsReceivePlanService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应收货物计划Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-05-10
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class WmsReceivePlanServiceImpl implements IWmsReceivePlanService {
|
||||||
|
|
||||||
|
private final WmsReceivePlanMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询应收货物计划
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public WmsReceivePlanVo queryById(Long receiveId){
|
||||||
|
return baseMapper.selectVoById(receiveId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询应收货物计划列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<WmsReceivePlanVo> queryPageList(WmsReceivePlanBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<WmsReceivePlan> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<WmsReceivePlanVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询应收货物计划列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<WmsReceivePlanVo> queryList(WmsReceivePlanBo bo) {
|
||||||
|
LambdaQueryWrapper<WmsReceivePlan> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<WmsReceivePlan> buildQueryWrapper(WmsReceivePlanBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<WmsReceivePlan> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getPlanId() != null, WmsReceivePlan::getPlanId, bo.getPlanId());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getWarehouseArea()), WmsReceivePlan::getWarehouseArea, bo.getWarehouseArea());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getLotNo()), WmsReceivePlan::getLotNo, bo.getLotNo());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSupplierLotNo()), WmsReceivePlan::getSupplierLotNo, bo.getSupplierLotNo());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getProductLotNo()), WmsReceivePlan::getProductLotNo, bo.getProductLotNo());
|
||||||
|
lqw.eq(bo.getProductionDate() != null, WmsReceivePlan::getProductionDate, bo.getProductionDate());
|
||||||
|
lqw.eq(bo.getWeight() != null, WmsReceivePlan::getWeight, bo.getWeight());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getReceiveStatus()), WmsReceivePlan::getReceiveStatus, bo.getReceiveStatus());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getGoodsName()), WmsReceivePlan::getGoodsName, bo.getGoodsName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSpec()), WmsReceivePlan::getSpec, bo.getSpec());
|
||||||
|
lqw.eq(bo.getLength() != null, WmsReceivePlan::getLength, bo.getLength());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getMaterialType()), WmsReceivePlan::getMaterialType, bo.getMaterialType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getManufacturer()), WmsReceivePlan::getManufacturer, bo.getManufacturer());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceTreatment()), WmsReceivePlan::getSurfaceTreatment, bo.getSurfaceTreatment());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getZincCoating()), WmsReceivePlan::getZincCoating, bo.getZincCoating());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getTeamGroup()), WmsReceivePlan::getTeamGroup, bo.getTeamGroup());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getTemperRolling()), WmsReceivePlan::getTemperRolling, bo.getTemperRolling());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getCoatingType()), WmsReceivePlan::getCoatingType, bo.getCoatingType());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getGoodsType()), WmsReceivePlan::getGoodsType, bo.getGoodsType());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增应收货物计划
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Long insertByBo(WmsReceivePlanBo bo) {
|
||||||
|
WmsReceivePlan add = BeanUtil.toBean(bo, WmsReceivePlan.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setReceiveId(add.getReceiveId());
|
||||||
|
}
|
||||||
|
return add.getReceiveId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改应收货物计划
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(WmsReceivePlanBo bo) {
|
||||||
|
WmsReceivePlan update = BeanUtil.toBean(bo, WmsReceivePlan.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(WmsReceivePlan entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除应收货物计划
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?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="com.klp.mapper.WmsReceivePlanMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.klp.domain.WmsReceivePlan" id="WmsReceivePlanResult">
|
||||||
|
<result property="receiveId" column="receive_id"/>
|
||||||
|
<result property="planId" column="plan_id"/>
|
||||||
|
<result property="warehouseArea" column="warehouse_area"/>
|
||||||
|
<result property="lotNo" column="lot_no"/>
|
||||||
|
<result property="supplierLotNo" column="supplier_lot_no"/>
|
||||||
|
<result property="productLotNo" column="product_lot_no"/>
|
||||||
|
<result property="productionDate" column="production_date"/>
|
||||||
|
<result property="weight" column="weight"/>
|
||||||
|
<result property="receiveStatus" column="receive_status"/>
|
||||||
|
<result property="goodsName" column="goods_name"/>
|
||||||
|
<result property="spec" column="spec"/>
|
||||||
|
<result property="length" column="length"/>
|
||||||
|
<result property="materialType" column="material_type"/>
|
||||||
|
<result property="manufacturer" column="manufacturer"/>
|
||||||
|
<result property="surfaceTreatment" column="surface_treatment"/>
|
||||||
|
<result property="zincCoating" column="zinc_coating"/>
|
||||||
|
<result property="teamGroup" column="team_group"/>
|
||||||
|
<result property="temperRolling" column="temper_rolling"/>
|
||||||
|
<result property="coatingType" column="coating_type"/>
|
||||||
|
<result property="goodsType" column="goods_type"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user