diff --git a/klp-wms/src/main/java/com/klp/controller/WmsReceivePlanController.java b/klp-wms/src/main/java/com/klp/controller/WmsReceivePlanController.java new file mode 100644 index 00000000..114f4cce --- /dev/null +++ b/klp-wms/src/main/java/com/klp/controller/WmsReceivePlanController.java @@ -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 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 list = iWmsReceivePlanService.queryList(bo); + ExcelUtil.exportExcel(list, "应收货物计划", WmsReceivePlanVo.class, response); + } + + /** + * 获取应收货物计划详细信息 + * + * @param receiveId 主键 + */ + @GetMapping("/{receiveId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long receiveId) { + return R.ok(iWmsReceivePlanService.queryById(receiveId)); + } + + /** + * 新增应收货物计划 + */ + @Log(title = "应收货物计划", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody WmsReceivePlanBo bo) { + return R.ok(iWmsReceivePlanService.insertByBo(bo)); + } + + /** + * 修改应收货物计划 + */ + @Log(title = "应收货物计划", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody WmsReceivePlanBo bo) { + return toAjax(iWmsReceivePlanService.updateByBo(bo)); + } + + /** + * 删除应收货物计划 + * + * @param receiveIds 主键串 + */ + @Log(title = "应收货物计划", businessType = BusinessType.DELETE) + @DeleteMapping("/{receiveIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] receiveIds) { + return toAjax(iWmsReceivePlanService.deleteWithValidByIds(Arrays.asList(receiveIds), true)); + } +} diff --git a/klp-wms/src/main/java/com/klp/domain/WmsReceivePlan.java b/klp-wms/src/main/java/com/klp/domain/WmsReceivePlan.java new file mode 100644 index 00000000..061b751d --- /dev/null +++ b/klp-wms/src/main/java/com/klp/domain/WmsReceivePlan.java @@ -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; + +} diff --git a/klp-wms/src/main/java/com/klp/domain/bo/WmsReceivePlanBo.java b/klp-wms/src/main/java/com/klp/domain/bo/WmsReceivePlanBo.java new file mode 100644 index 00000000..d136c1a3 --- /dev/null +++ b/klp-wms/src/main/java/com/klp/domain/bo/WmsReceivePlanBo.java @@ -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; + + +} diff --git a/klp-wms/src/main/java/com/klp/domain/vo/WmsReceivePlanVo.java b/klp-wms/src/main/java/com/klp/domain/vo/WmsReceivePlanVo.java new file mode 100644 index 00000000..4a308db2 --- /dev/null +++ b/klp-wms/src/main/java/com/klp/domain/vo/WmsReceivePlanVo.java @@ -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; + + +} diff --git a/klp-wms/src/main/java/com/klp/mapper/WmsReceivePlanMapper.java b/klp-wms/src/main/java/com/klp/mapper/WmsReceivePlanMapper.java new file mode 100644 index 00000000..94d77352 --- /dev/null +++ b/klp-wms/src/main/java/com/klp/mapper/WmsReceivePlanMapper.java @@ -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 { + +} diff --git a/klp-wms/src/main/java/com/klp/service/IWmsReceivePlanService.java b/klp-wms/src/main/java/com/klp/service/IWmsReceivePlanService.java new file mode 100644 index 00000000..85e2532f --- /dev/null +++ b/klp-wms/src/main/java/com/klp/service/IWmsReceivePlanService.java @@ -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 queryPageList(WmsReceivePlanBo bo, PageQuery pageQuery); + + /** + * 查询应收货物计划列表 + */ + List queryList(WmsReceivePlanBo bo); + + /** + * 新增应收货物计划 + */ + Long insertByBo(WmsReceivePlanBo bo); + + /** + * 修改应收货物计划 + */ + Boolean updateByBo(WmsReceivePlanBo bo); + + /** + * 校验并批量删除应收货物计划信息 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/klp-wms/src/main/java/com/klp/service/impl/WmsReceivePlanServiceImpl.java b/klp-wms/src/main/java/com/klp/service/impl/WmsReceivePlanServiceImpl.java new file mode 100644 index 00000000..86345ea6 --- /dev/null +++ b/klp-wms/src/main/java/com/klp/service/impl/WmsReceivePlanServiceImpl.java @@ -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 queryPageList(WmsReceivePlanBo bo, PageQuery pageQuery) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询应收货物计划列表 + */ + @Override + public List queryList(WmsReceivePlanBo bo) { + LambdaQueryWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private LambdaQueryWrapper buildQueryWrapper(WmsReceivePlanBo bo) { + Map params = bo.getParams(); + LambdaQueryWrapper 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 ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteBatchIds(ids) > 0; + } +} diff --git a/klp-wms/src/main/resources/mapper/klp/WmsReceivePlanMapper.xml b/klp-wms/src/main/resources/mapper/klp/WmsReceivePlanMapper.xml new file mode 100644 index 00000000..2ab2c38d --- /dev/null +++ b/klp-wms/src/main/resources/mapper/klp/WmsReceivePlanMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +