diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsPurchaseOrderController.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsPurchaseOrderController.java new file mode 100644 index 00000000..f8f65693 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsPurchaseOrderController.java @@ -0,0 +1,117 @@ +package org.dromara.wms.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.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.wms.domain.vo.WmsPurchaseOrderVo; +import org.dromara.wms.domain.bo.WmsPurchaseOrderBo; +import org.dromara.wms.service.IWmsPurchaseOrderService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 采购订单 + * 前端访问路由地址为:/wms/wmsPurchaseOrder + * + * @author ZangCH + * @date 2025-01-08 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/wmsPurchaseOrder") +public class WmsPurchaseOrderController extends BaseController { + + private final IWmsPurchaseOrderService wmsPurchaseOrderService; + + /** + * 查询采购订单列表 + */ + @SaCheckPermission("wms:wmsPurchaseOrder:list") + @GetMapping("/list") + public TableDataInfo list(WmsPurchaseOrderBo bo, PageQuery pageQuery) { + return wmsPurchaseOrderService.queryPageList(bo, pageQuery); + } + + /** + * 导出采购订单列表 + */ + @SaCheckPermission("wms:wmsPurchaseOrder:export") + @Log(title = "采购订单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(WmsPurchaseOrderBo bo, HttpServletResponse response) { + List list = wmsPurchaseOrderService.queryList(bo); + ExcelUtil.exportExcel(list, "采购订单", WmsPurchaseOrderVo.class, response); + } + + /** + * 获取采购订单详细信息 + * + * @param poId 主键 + */ + @SaCheckPermission("wms:wmsPurchaseOrder:query") + @GetMapping("/{poId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long poId) { + return R.ok(wmsPurchaseOrderService.queryById(poId)); + } + + /** + * 新增采购订单 + */ + @SaCheckPermission("wms:wmsPurchaseOrder:add") + @Log(title = "采购订单", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody WmsPurchaseOrderBo bo) { + return toAjax(wmsPurchaseOrderService.insertByBo(bo)); + } + + /** + * 修改采购订单 + */ + @SaCheckPermission("wms:wmsPurchaseOrder:edit") + @Log(title = "采购订单", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody WmsPurchaseOrderBo bo) { + return toAjax(wmsPurchaseOrderService.updateByBo(bo)); + } + + /** + * 删除采购订单 + * + * @param poIds 主键串 + */ + @SaCheckPermission("wms:wmsPurchaseOrder:remove") + @Log(title = "采购订单", businessType = BusinessType.DELETE) + @DeleteMapping("/{poIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] poIds) { + return toAjax(wmsPurchaseOrderService.deleteWithValidByIds(List.of(poIds), true)); + } + + + /** + * 下拉框查询采购订单列表 + */ + + @GetMapping("getWmsPurchaseOrderList") + public R> getWmsPurchaseOrderlist(WmsPurchaseOrderBo bo) { + List list = wmsPurchaseOrderService.queryList(bo); + return R.ok(list); + } +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsPurchaseOrderDetailController.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsPurchaseOrderDetailController.java new file mode 100644 index 00000000..b53d4ac6 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsPurchaseOrderDetailController.java @@ -0,0 +1,117 @@ +package org.dromara.wms.controller; + +import java.util.List; + +import lombok.RequiredArgsConstructor; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.constraints.*; +import cn.dev33.satoken.annotation.SaCheckPermission; +import org.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.wms.domain.vo.WmsPurchaseOrderDetailVo; +import org.dromara.wms.domain.bo.WmsPurchaseOrderDetailBo; +import org.dromara.wms.service.IWmsPurchaseOrderDetailService; +import org.dromara.common.mybatis.core.page.TableDataInfo; + +/** + * 采购订单-物料 + * 前端访问路由地址为:/wms/wmsPurchaseOrderDetail + * + * @author ZangCH + * @date 2025-01-08 + */ +@Validated +@RequiredArgsConstructor +@RestController +@RequestMapping("/wmsPurchaseOrderDetail") +public class WmsPurchaseOrderDetailController extends BaseController { + + private final IWmsPurchaseOrderDetailService wmsPurchaseOrderDetailService; + + /** + * 查询采购订单-物料列表 + */ + @SaCheckPermission("wms:wmsPurchaseOrderDetail:list") + @GetMapping("/list") + public TableDataInfo list(WmsPurchaseOrderDetailBo bo, PageQuery pageQuery) { + return wmsPurchaseOrderDetailService.queryPageList(bo, pageQuery); + } + + /** + * 导出采购订单-物料列表 + */ + @SaCheckPermission("wms:wmsPurchaseOrderDetail:export") + @Log(title = "采购订单-物料", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(WmsPurchaseOrderDetailBo bo, HttpServletResponse response) { + List list = wmsPurchaseOrderDetailService.queryList(bo); + ExcelUtil.exportExcel(list, "采购订单-物料", WmsPurchaseOrderDetailVo.class, response); + } + + /** + * 获取采购订单-物料详细信息 + * + * @param poDId 主键 + */ + @SaCheckPermission("wms:wmsPurchaseOrderDetail:query") + @GetMapping("/{poDId}") + public R getInfo(@NotNull(message = "主键不能为空") + @PathVariable Long poDId) { + return R.ok(wmsPurchaseOrderDetailService.queryById(poDId)); + } + + /** + * 新增采购订单-物料 + */ + @SaCheckPermission("wms:wmsPurchaseOrderDetail:add") + @Log(title = "采购订单-物料", businessType = BusinessType.INSERT) + @RepeatSubmit() + @PostMapping() + public R add(@Validated(AddGroup.class) @RequestBody WmsPurchaseOrderDetailBo bo) { + return toAjax(wmsPurchaseOrderDetailService.insertByBo(bo)); + } + + /** + * 修改采购订单-物料 + */ + @SaCheckPermission("wms:wmsPurchaseOrderDetail:edit") + @Log(title = "采购订单-物料", businessType = BusinessType.UPDATE) + @RepeatSubmit() + @PutMapping() + public R edit(@Validated(EditGroup.class) @RequestBody WmsPurchaseOrderDetailBo bo) { + return toAjax(wmsPurchaseOrderDetailService.updateByBo(bo)); + } + + /** + * 删除采购订单-物料 + * + * @param poDIds 主键串 + */ + @SaCheckPermission("wms:wmsPurchaseOrderDetail:remove") + @Log(title = "采购订单-物料", businessType = BusinessType.DELETE) + @DeleteMapping("/{poDIds}") + public R remove(@NotEmpty(message = "主键不能为空") + @PathVariable Long[] poDIds) { + return toAjax(wmsPurchaseOrderDetailService.deleteWithValidByIds(List.of(poDIds), true)); + } + + + /** + * 下拉框查询采购订单-物料列表 + */ + + @GetMapping("getWmsPurchaseOrderDetailList") + public R> getWmsPurchaseOrderDetaillist(WmsPurchaseOrderDetailBo bo) { + List list = wmsPurchaseOrderDetailService.queryList(bo); + return R.ok(list); + } +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsPurchaseOrder.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsPurchaseOrder.java new file mode 100644 index 00000000..a308aa15 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsPurchaseOrder.java @@ -0,0 +1,93 @@ +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_purchase_order + * + * @author ZangCH + * @date 2025-01-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("wms_purchase_order") +public class WmsPurchaseOrder extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 表主键 + */ + @TableId(value = "po_id", type = IdType.AUTO) + private Long poId; + + /** + * 订单编号 + */ + private String poNo; + + /** + * 订单状态(1待采购2部分到货3订单完成) + */ + private String poStatus; + + /** + * 计划交货日期 + */ + private String planDeliveryDate; + + /** + * 供应商ID + */ + private Long supplierId; + + /** + * 订单类型(1人工创建,2ERP同步,3后台创建4) + */ + private String poType; + + /** + * 单据的ID,连表扩充 + */ + private Long erpId; + + /** + * 备注 + */ + private String remark; + + /** + * 物料大类 + */ + private String materialCategories; + + /** + * 审核人 + */ + private String auditBy; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + private String auditStatus; + + /** + * 审核意见 + */ + private String auditComments; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsPurchaseOrderDetail.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsPurchaseOrderDetail.java new file mode 100644 index 00000000..ec57ccb6 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsPurchaseOrderDetail.java @@ -0,0 +1,71 @@ +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; + +/** + * 采购订单-物料对象 wms_purchase_order_detail + * + * @author ZangCH + * @date 2025-01-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("wms_purchase_order_detail") +public class WmsPurchaseOrderDetail extends TenantEntity { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 采购物料表主键 + */ + @TableId(value = "po_d_id", type = IdType.AUTO) + private Long poDId; + + /** + * 物料编码 + */ + private String materialCode; + + /** + * 物料名称 + */ + private String materialName; + + /** + * 采购订单编号 + */ + private String poNo; + + /** + * 含税单价 + */ + private Long taxPrice; + + /** + * 采购数量 + */ + private Long purchaseQty; + + /** + * 物料规格 + */ + private String materialSpe; + + /** + * 计量单位名称 + */ + private String unitName; + + /** + * 送货数量=送货单数量=总入库数量 + */ + private Long deliveryQty; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsPurchaseOrderBo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsPurchaseOrderBo.java new file mode 100644 index 00000000..3387cd7f --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsPurchaseOrderBo.java @@ -0,0 +1,92 @@ +package org.dromara.wms.domain.bo; + +import org.dromara.wms.domain.WmsPurchaseOrder; +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; + +/** + * 采购订单业务对象 wms_purchase_order + * + * @author ZangCH + * @date 2025-01-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = WmsPurchaseOrder.class, reverseConvertGenerate = false) +public class WmsPurchaseOrderBo extends BaseEntity { + + /** + * 表主键 + */ + private Long poId; + + /** + * 订单编号 + */ + @NotBlank(message = "订单编号不能为空", groups = { AddGroup.class, EditGroup.class }) + private String poNo; + + /** + * 订单状态(1待采购2部分到货3订单完成) + */ + private String poStatus; + + /** + * 计划交货日期 + */ + private String planDeliveryDate; + + /** + * 供应商ID + */ + private Long supplierId; + + /** + * 订单类型(1人工创建,2ERP同步,3后台创建4) + */ + private String poType; + + /** + * 单据的ID,连表扩充 + */ + private Long erpId; + + /** + * 备注 + */ + private String remark; + + /** + * 物料大类 + */ + private String materialCategories; + + /** + * 审核人 + */ + private String auditBy; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + private String auditStatus; + + /** + * 审核意见 + */ + private String auditComments; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsPurchaseOrderDetailBo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsPurchaseOrderDetailBo.java new file mode 100644 index 00000000..4ce6f392 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsPurchaseOrderDetailBo.java @@ -0,0 +1,72 @@ +package org.dromara.wms.domain.bo; + +import org.dromara.wms.domain.WmsPurchaseOrderDetail; +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.*; + +/** + * 采购订单-物料业务对象 wms_purchase_order_detail + * + * @author ZangCH + * @date 2025-01-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@AutoMapper(target = WmsPurchaseOrderDetail.class, reverseConvertGenerate = false) +public class WmsPurchaseOrderDetailBo extends BaseEntity { + + /** + * 采购物料表主键 + */ + private Long poDId; + + /** + * 物料编码 + */ + @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 poNo; + + /** + * 含税单价 + */ + private Long taxPrice; + + /** + * 采购数量 + */ + private Long purchaseQty; + + /** + * 物料规格 + */ + private String materialSpe; + + /** + * 计量单位名称 + */ + private String unitName; + + /** + * 送货数量=送货单数量=总入库数量 + */ + private Long deliveryQty; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsPurchaseOrderDetailVo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsPurchaseOrderDetailVo.java new file mode 100644 index 00000000..2c073e18 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsPurchaseOrderDetailVo.java @@ -0,0 +1,98 @@ +package org.dromara.wms.domain.vo; + +import org.dromara.wms.domain.WmsPurchaseOrderDetail; +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_purchase_order_detail + * + * @author ZangCH + * @date 2025-01-08 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = WmsPurchaseOrderDetail.class) +public class WmsPurchaseOrderDetailVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 采购物料表主键 + */ + @ExcelProperty(value = "采购物料表主键") + private Long poDId; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + + /** + * 物料编码 + */ + @ExcelProperty(value = "物料编码") + private String materialCode; + + /** + * 物料名称 + */ + @ExcelProperty(value = "物料名称") + private String materialName; + + /** + * 采购订单编号 + */ + @ExcelProperty(value = "采购订单编号") + private String poNo; + + /** + * 含税单价 + */ + @ExcelProperty(value = "含税单价") + private Long taxPrice; + + /** + * 采购数量 + */ + @ExcelProperty(value = "采购数量") + private Long purchaseQty; + + /** + * 物料规格 + */ + @ExcelProperty(value = "物料规格") + private String materialSpe; + + /** + * 计量单位名称 + */ + @ExcelProperty(value = "计量单位名称") + private String unitName; + + /** + * 送货数量=送货单数量=总入库数量 + */ + @ExcelProperty(value = "送货数量=送货单数量=总入库数量") + private Long deliveryQty; + + /** + * 租户号 + */ + @ExcelProperty(value = "租户号") + private String tenantId; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsPurchaseOrderVo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsPurchaseOrderVo.java new file mode 100644 index 00000000..109f8d3d --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/WmsPurchaseOrderVo.java @@ -0,0 +1,146 @@ +package org.dromara.wms.domain.vo; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.dromara.wms.domain.WmsPurchaseOrder; +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_purchase_order + * + * @author ZangCH + * @date 2025-01-08 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = WmsPurchaseOrder.class) +public class WmsPurchaseOrderVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 表主键 + */ + @ExcelProperty(value = "表主键") + private Long poId; + + /** + * 订单编号 + */ + @ExcelProperty(value = "订单编号") + private String poNo; + + /** + * 订单状态(1待采购2部分到货3订单完成) + */ + @ExcelProperty(value = "订单状态(1待采购2部分到货3订单完成)", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "wms_po_status") + private String poStatus; + + /** + * 计划交货日期 + */ + @ExcelProperty(value = "计划交货日期") + private String planDeliveryDate; + + /** + * 供应商ID + */ + @ExcelProperty(value = "供应商ID") + private Long supplierId; + + /** + * 订单类型(1人工创建,2ERP同步,3后台创建4) + */ + @ExcelProperty(value = "订单类型(1人工创建,2ERP同步,3后台创建4)", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "wms_po_type") + private String poType; + + /** + * 单据的ID,连表扩充 + */ + @ExcelProperty(value = "单据的ID,连表扩充") + private Long erpId; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 租户号 + */ + @ExcelProperty(value = "租户号") + private String tenantId; + + /** + * 创建人 + */ + @ExcelProperty(value = "创建人") + private String createBy; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + + /** + * 更新人 + */ + @ExcelProperty(value = "更新人") + private String updateBy; + + /** + * 更新时间 + */ + @ExcelProperty(value = "更新时间") + private Date updateTime; + + /** + * 物料大类 + */ + @ExcelProperty(value = "物料大类", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "material_mategories") + private String materialCategories; + + /** + * 审核人 + */ + @ExcelProperty(value = "审核人") + private String auditBy; + + /** + * 审核时间 + */ + @ExcelProperty(value = "审核时间") + private Date auditTime; + + /** + * 审核状态(0待审核,1审核通过,2审核未通过) + */ + @ExcelProperty(value = "审核状态(0待审核,1审核通过,2审核未通过)", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "wms_audit_status") + private String auditStatus; + + /** + * 审核意见 + */ + @ExcelProperty(value = "审核意见") + private String auditComments; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsPurchaseOrderDetailMapper.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsPurchaseOrderDetailMapper.java new file mode 100644 index 00000000..8caae491 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsPurchaseOrderDetailMapper.java @@ -0,0 +1,15 @@ +package org.dromara.wms.mapper; + +import org.dromara.wms.domain.WmsPurchaseOrderDetail; +import org.dromara.wms.domain.vo.WmsPurchaseOrderDetailVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 采购订单-物料Mapper接口 + * + * @author ZangCH + * @date 2025-01-08 + */ +public interface WmsPurchaseOrderDetailMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsPurchaseOrderMapper.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsPurchaseOrderMapper.java new file mode 100644 index 00000000..03fe8923 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/WmsPurchaseOrderMapper.java @@ -0,0 +1,15 @@ +package org.dromara.wms.mapper; + +import org.dromara.wms.domain.WmsPurchaseOrder; +import org.dromara.wms.domain.vo.WmsPurchaseOrderVo; +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; + +/** + * 采购订单Mapper接口 + * + * @author ZangCH + * @date 2025-01-08 + */ +public interface WmsPurchaseOrderMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsPurchaseOrderDetailService.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsPurchaseOrderDetailService.java new file mode 100644 index 00000000..021daa4a --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsPurchaseOrderDetailService.java @@ -0,0 +1,69 @@ +package org.dromara.wms.service; + +import org.dromara.wms.domain.WmsPurchaseOrderDetail; +import org.dromara.wms.domain.vo.WmsPurchaseOrderDetailVo; +import org.dromara.wms.domain.bo.WmsPurchaseOrderDetailBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 采购订单-物料Service接口 + * + * @author ZangCH + * @date 2025-01-08 + */ +public interface IWmsPurchaseOrderDetailService { + + /** + * 查询采购订单-物料 + * + * @param poDId 主键 + * @return 采购订单-物料 + */ + WmsPurchaseOrderDetailVo queryById(Long poDId); + + /** + * 分页查询采购订单-物料列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 采购订单-物料分页列表 + */ + TableDataInfo queryPageList(WmsPurchaseOrderDetailBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的采购订单-物料列表 + * + * @param bo 查询条件 + * @return 采购订单-物料列表 + */ + List queryList(WmsPurchaseOrderDetailBo bo); + + /** + * 新增采购订单-物料 + * + * @param bo 采购订单-物料 + * @return 是否新增成功 + */ + Boolean insertByBo(WmsPurchaseOrderDetailBo bo); + + /** + * 修改采购订单-物料 + * + * @param bo 采购订单-物料 + * @return 是否修改成功 + */ + Boolean updateByBo(WmsPurchaseOrderDetailBo bo); + + /** + * 校验并批量删除采购订单-物料信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsPurchaseOrderService.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsPurchaseOrderService.java new file mode 100644 index 00000000..3a0adeb4 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsPurchaseOrderService.java @@ -0,0 +1,69 @@ +package org.dromara.wms.service; + +import org.dromara.wms.domain.WmsPurchaseOrder; +import org.dromara.wms.domain.vo.WmsPurchaseOrderVo; +import org.dromara.wms.domain.bo.WmsPurchaseOrderBo; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; + +import java.util.Collection; +import java.util.List; + +/** + * 采购订单Service接口 + * + * @author ZangCH + * @date 2025-01-08 + */ +public interface IWmsPurchaseOrderService { + + /** + * 查询采购订单 + * + * @param poId 主键 + * @return 采购订单 + */ + WmsPurchaseOrderVo queryById(Long poId); + + /** + * 分页查询采购订单列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 采购订单分页列表 + */ + TableDataInfo queryPageList(WmsPurchaseOrderBo bo, PageQuery pageQuery); + + /** + * 查询符合条件的采购订单列表 + * + * @param bo 查询条件 + * @return 采购订单列表 + */ + List queryList(WmsPurchaseOrderBo bo); + + /** + * 新增采购订单 + * + * @param bo 采购订单 + * @return 是否新增成功 + */ + Boolean insertByBo(WmsPurchaseOrderBo bo); + + /** + * 修改采购订单 + * + * @param bo 采购订单 + * @return 是否修改成功 + */ + Boolean updateByBo(WmsPurchaseOrderBo bo); + + /** + * 校验并批量删除采购订单信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + Boolean deleteWithValidByIds(Collection ids, Boolean isValid); +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsPurchaseOrderDetailServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsPurchaseOrderDetailServiceImpl.java new file mode 100644 index 00000000..967a0af0 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsPurchaseOrderDetailServiceImpl.java @@ -0,0 +1,139 @@ +package org.dromara.wms.service.impl; + +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.wms.domain.bo.WmsPurchaseOrderDetailBo; +import org.dromara.wms.domain.vo.WmsPurchaseOrderDetailVo; +import org.dromara.wms.domain.WmsPurchaseOrderDetail; +import org.dromara.wms.mapper.WmsPurchaseOrderDetailMapper; +import org.dromara.wms.service.IWmsPurchaseOrderDetailService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 采购订单-物料Service业务层处理 + * + * @author ZangCH + * @date 2025-01-08 + */ +@RequiredArgsConstructor +@Service +public class WmsPurchaseOrderDetailServiceImpl implements IWmsPurchaseOrderDetailService { + + private final WmsPurchaseOrderDetailMapper baseMapper; + + /** + * 查询采购订单-物料 + * + * @param poDId 主键 + * @return 采购订单-物料 + */ + @Override + public WmsPurchaseOrderDetailVo queryById(Long poDId){ + return baseMapper.selectVoById(poDId); + } + + /** + * 分页查询采购订单-物料列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 采购订单-物料分页列表 + */ + @Override + public TableDataInfo queryPageList(WmsPurchaseOrderDetailBo bo, PageQuery pageQuery) { + MPJLambdaWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的采购订单-物料列表 + * + * @param bo 查询条件 + * @return 采购订单-物料列表 + */ + @Override + public List queryList(WmsPurchaseOrderDetailBo bo) { + MPJLambdaWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private MPJLambdaWrapper buildQueryWrapper(WmsPurchaseOrderDetailBo bo) { + Map params = bo.getParams(); + MPJLambdaWrapper lqw = JoinWrappers.lambda(WmsPurchaseOrderDetail.class) + .selectAll(WmsPurchaseOrderDetail.class) + .eq(StringUtils.isNotBlank(bo.getMaterialCode()), WmsPurchaseOrderDetail::getMaterialCode, bo.getMaterialCode()) + .like(StringUtils.isNotBlank(bo.getMaterialName()), WmsPurchaseOrderDetail::getMaterialName, bo.getMaterialName()) + .eq(StringUtils.isNotBlank(bo.getPoNo()), WmsPurchaseOrderDetail::getPoNo, bo.getPoNo()) + .eq(bo.getTaxPrice() != null, WmsPurchaseOrderDetail::getTaxPrice, bo.getTaxPrice()) + .eq(bo.getPurchaseQty() != null, WmsPurchaseOrderDetail::getPurchaseQty, bo.getPurchaseQty()) + .eq(StringUtils.isNotBlank(bo.getMaterialSpe()), WmsPurchaseOrderDetail::getMaterialSpe, bo.getMaterialSpe()) + .like(StringUtils.isNotBlank(bo.getUnitName()), WmsPurchaseOrderDetail::getUnitName, bo.getUnitName()) + .eq(bo.getDeliveryQty() != null, WmsPurchaseOrderDetail::getDeliveryQty, bo.getDeliveryQty()) + .orderByDesc(WmsPurchaseOrderDetail::getCreateTime); + return lqw; + } + + /** + * 新增采购订单-物料 + * + * @param bo 采购订单-物料 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(WmsPurchaseOrderDetailBo bo) { + WmsPurchaseOrderDetail add = MapstructUtils.convert(bo, WmsPurchaseOrderDetail.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setPoDId(add.getPoDId()); + } + return flag; + } + + /** + * 修改采购订单-物料 + * + * @param bo 采购订单-物料 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(WmsPurchaseOrderDetailBo bo) { + WmsPurchaseOrderDetail update = MapstructUtils.convert(bo, WmsPurchaseOrderDetail.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(WmsPurchaseOrderDetail entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除采购订单-物料信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsPurchaseOrderServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsPurchaseOrderServiceImpl.java new file mode 100644 index 00000000..316ceb18 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsPurchaseOrderServiceImpl.java @@ -0,0 +1,142 @@ +package org.dromara.wms.service.impl; + +import org.dromara.common.core.utils.MapstructUtils; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.mybatis.core.page.TableDataInfo; +import org.dromara.common.mybatis.core.page.PageQuery; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.github.yulichang.toolkit.JoinWrappers; +import com.github.yulichang.wrapper.MPJLambdaWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; +import org.dromara.wms.domain.bo.WmsPurchaseOrderBo; +import org.dromara.wms.domain.vo.WmsPurchaseOrderVo; +import org.dromara.wms.domain.WmsPurchaseOrder; +import org.dromara.wms.mapper.WmsPurchaseOrderMapper; +import org.dromara.wms.service.IWmsPurchaseOrderService; + +import java.util.List; +import java.util.Map; +import java.util.Collection; + +/** + * 采购订单Service业务层处理 + * + * @author ZangCH + * @date 2025-01-08 + */ +@RequiredArgsConstructor +@Service +public class WmsPurchaseOrderServiceImpl implements IWmsPurchaseOrderService { + + private final WmsPurchaseOrderMapper baseMapper; + + /** + * 查询采购订单 + * + * @param poId 主键 + * @return 采购订单 + */ + @Override + public WmsPurchaseOrderVo queryById(Long poId){ + return baseMapper.selectVoById(poId); + } + + /** + * 分页查询采购订单列表 + * + * @param bo 查询条件 + * @param pageQuery 分页参数 + * @return 采购订单分页列表 + */ + @Override + public TableDataInfo queryPageList(WmsPurchaseOrderBo bo, PageQuery pageQuery) { + MPJLambdaWrapper lqw = buildQueryWrapper(bo); + Page result = baseMapper.selectVoPage(pageQuery.build(), lqw); + return TableDataInfo.build(result); + } + + /** + * 查询符合条件的采购订单列表 + * + * @param bo 查询条件 + * @return 采购订单列表 + */ + @Override + public List queryList(WmsPurchaseOrderBo bo) { + MPJLambdaWrapper lqw = buildQueryWrapper(bo); + return baseMapper.selectVoList(lqw); + } + + private MPJLambdaWrapper buildQueryWrapper(WmsPurchaseOrderBo bo) { + Map params = bo.getParams(); + MPJLambdaWrapper lqw = JoinWrappers.lambda(WmsPurchaseOrder.class) + .selectAll(WmsPurchaseOrder.class) + .eq(StringUtils.isNotBlank(bo.getPoNo()), WmsPurchaseOrder::getPoNo, bo.getPoNo()) + .eq(StringUtils.isNotBlank(bo.getPoStatus()), WmsPurchaseOrder::getPoStatus, bo.getPoStatus()) + .eq(StringUtils.isNotBlank(bo.getPlanDeliveryDate()), WmsPurchaseOrder::getPlanDeliveryDate, bo.getPlanDeliveryDate()) + .eq(bo.getSupplierId() != null, WmsPurchaseOrder::getSupplierId, bo.getSupplierId()) + .eq(StringUtils.isNotBlank(bo.getPoType()), WmsPurchaseOrder::getPoType, bo.getPoType()) + .eq(bo.getErpId() != null, WmsPurchaseOrder::getErpId, bo.getErpId()) + .eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsPurchaseOrder::getMaterialCategories, bo.getMaterialCategories()) + .eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsPurchaseOrder::getAuditBy, bo.getAuditBy()) + .eq(bo.getAuditTime() != null, WmsPurchaseOrder::getAuditTime, bo.getAuditTime()) + .eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsPurchaseOrder::getAuditStatus, bo.getAuditStatus()) + .eq(StringUtils.isNotBlank(bo.getAuditComments()), WmsPurchaseOrder::getAuditComments, bo.getAuditComments()) + .orderByDesc(WmsPurchaseOrder::getCreateTime); + return lqw; + } + + /** + * 新增采购订单 + * + * @param bo 采购订单 + * @return 是否新增成功 + */ + @Override + public Boolean insertByBo(WmsPurchaseOrderBo bo) { + WmsPurchaseOrder add = MapstructUtils.convert(bo, WmsPurchaseOrder.class); + validEntityBeforeSave(add); + boolean flag = baseMapper.insert(add) > 0; + if (flag) { + bo.setPoId(add.getPoId()); + } + return flag; + } + + /** + * 修改采购订单 + * + * @param bo 采购订单 + * @return 是否修改成功 + */ + @Override + public Boolean updateByBo(WmsPurchaseOrderBo bo) { + WmsPurchaseOrder update = MapstructUtils.convert(bo, WmsPurchaseOrder.class); + validEntityBeforeSave(update); + return baseMapper.updateById(update) > 0; + } + + /** + * 保存前的数据校验 + */ + private void validEntityBeforeSave(WmsPurchaseOrder entity){ + //TODO 做一些数据校验,如唯一约束 + } + + /** + * 校验并批量删除采购订单信息 + * + * @param ids 待删除的主键集合 + * @param isValid 是否进行有效性校验 + * @return 是否删除成功 + */ + @Override + public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { + if(isValid){ + //TODO 做一些业务上的校验,判断是否需要校验 + } + return baseMapper.deleteByIds(ids) > 0; + } +} diff --git a/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsPurchaseOrderDetailMapper.xml b/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsPurchaseOrderDetailMapper.xml new file mode 100644 index 00000000..7e403c80 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsPurchaseOrderDetailMapper.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsPurchaseOrderMapper.xml b/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsPurchaseOrderMapper.xml new file mode 100644 index 00000000..0550bad2 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsPurchaseOrderMapper.xml @@ -0,0 +1,7 @@ + + + + +