From a4a0afee86927b2fa28c6e6173211d12b9bac818 Mon Sep 17 00:00:00 2001 From: "maxw@mesnac.com" Date: Wed, 5 Feb 2025 15:55:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E4=B8=BB?= =?UTF-8?q?=E5=AD=90=E8=A1=A8=E9=A1=B5=E9=9D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WmsPurchaseOrderController.java | 4 +- .../dromara/wms/domain/BaseSupplierInfo.java | 90 ++++++++++++++ .../org/dromara/wms/domain/WmsInventory.java | 2 +- .../dromara/wms/domain/WmsPurchaseOrder.java | 33 ++++- .../wms/domain/WmsPurchaseOrderDetail.java | 7 +- .../dromara/wms/domain/bo/WmsInventoryBo.java | 1 + .../domain/bo/WmsPurchaseOrderDetailBo.java | 8 +- .../wms/domain/vo/BaseSupplierInfoVo.java | 116 ++++++++++++++++++ .../domain/vo/WmsPurchaseOrderDetailVo.java | 7 +- .../wms/domain/vo/WmsPurchaseOrderVo.java | 4 + .../wms/mapper/BaseSupplierInfoMapper.java | 15 +++ .../WmsInventoryCheckRecordServiceImpl.java | 4 +- .../service/impl/WmsMoveOrderServiceImpl.java | 4 +- .../impl/WmsPurchaseOrderServiceImpl.java | 42 +++++++ .../mapper/wms/WmsInventoryMapper.xml | 16 ++- 15 files changed, 330 insertions(+), 23 deletions(-) create mode 100644 ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/BaseSupplierInfo.java create mode 100644 ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/BaseSupplierInfoVo.java create mode 100644 ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/BaseSupplierInfoMapper.java 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 index c1529b62..7c0da25b 100644 --- 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 @@ -77,7 +77,7 @@ public class WmsPurchaseOrderController extends BaseController { @Log(title = "采购订单", businessType = BusinessType.INSERT) @RepeatSubmit() @PostMapping() - public R add(@Validated(AddGroup.class) @RequestBody WmsPurchaseOrderBo bo) { + public R add(@RequestBody WmsPurchaseOrderBo bo) { return R.ok(wmsPurchaseOrderService.insertByBo(bo)); } @@ -88,7 +88,7 @@ public class WmsPurchaseOrderController extends BaseController { @Log(title = "采购订单", businessType = BusinessType.UPDATE) @RepeatSubmit() @PutMapping() - public R edit(@Validated(EditGroup.class) @RequestBody WmsPurchaseOrderBo bo) { + public R edit(@RequestBody WmsPurchaseOrderBo bo) { return toAjax(wmsPurchaseOrderService.updateByBo(bo)); } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/BaseSupplierInfo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/BaseSupplierInfo.java new file mode 100644 index 00000000..c6074ca2 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/BaseSupplierInfo.java @@ -0,0 +1,90 @@ +package org.dromara.wms.domain; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.dromara.common.tenant.core.TenantEntity; + +import java.io.Serial; +import java.util.Date; + +/** + * 供应商信息对象 base_supplier_info + * + * @author ZangCH + * @date 2025-01-07 + */ +@Data +@TableName("base_supplier_info") +public class BaseSupplierInfo { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + @TableId(value = "supplier_id", type = IdType.AUTO) + private Long supplierId; + + /** + * 供应商编号 + */ + private String supplierCode; + + /** + * 供应商名称 + */ + private String supplierName; + + /** + * erp的主键 + */ + private Long erpId; + + /** + * 激活状态(1启用 0停用) + */ + private String supplierStatus; + + /** + * 审核日期 + */ + private Date auditDate; + + /** + * erp最后更新时间 + */ + private Date erpModifyDate; + + /** + * 备注 + */ + private String remark; + /** + * 租户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; + + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java index c582aa9b..74ac0e8c 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/WmsInventory.java @@ -93,7 +93,7 @@ public class WmsInventory{ private Date updateTime; @TableField(exist = false) private String warehouseCode;//字段映射 - @TableField(exist = false) +// @TableField(exist = false) private String materialCode;//字段映射 private String warehouseId; 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 index a308aa15..957fc868 100644 --- 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 @@ -16,9 +16,8 @@ import java.io.Serial; * @date 2025-01-08 */ @Data -@EqualsAndHashCode(callSuper = true) @TableName("wms_purchase_order") -public class WmsPurchaseOrder extends TenantEntity { +public class WmsPurchaseOrder { @Serial private static final long serialVersionUID = 1L; @@ -88,6 +87,36 @@ public class WmsPurchaseOrder extends TenantEntity { * 审核意见 */ private String auditComments; + /** + * 供应商编号 + */ + @TableField(exist = false) + private String supplierCode; + + /** + * 租户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; } 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 index 86d73a44..d8b9b4a5 100644 --- 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 @@ -6,6 +6,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serial; +import java.math.BigDecimal; /** * 采购订单-物料对象 wms_purchase_order_detail @@ -45,12 +46,12 @@ public class WmsPurchaseOrderDetail extends TenantEntity { /** * 含税单价 */ - private Long taxPrice; + private BigDecimal taxPrice; /** * 采购数量 */ - private Long purchaseQty; + private BigDecimal purchaseQty; /** * 物料规格 @@ -65,7 +66,7 @@ public class WmsPurchaseOrderDetail extends TenantEntity { /** * 送货数量=送货单数量=总入库数量 */ - private Long deliveryQty; + private BigDecimal deliveryQty; private Long materialId; diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsInventoryBo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsInventoryBo.java index f71fb547..d1fd96c9 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsInventoryBo.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/bo/WmsInventoryBo.java @@ -77,5 +77,6 @@ public class WmsInventoryBo extends BaseEntity { private Long storeId; private String tenantId; private String warehouseId; + private String materialCode;//字段映射 } 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 index 25eecce7..e7edf92f 100644 --- 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 @@ -9,6 +9,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import jakarta.validation.constraints.*; +import java.math.BigDecimal; + /** * 采购订单-物料业务对象 wms_purchase_order_detail * @@ -46,12 +48,12 @@ public class WmsPurchaseOrderDetailBo extends BaseEntity { /** * 含税单价 */ - private Long taxPrice; + private BigDecimal taxPrice; /** * 采购数量 */ - private Long purchaseQty; + private BigDecimal purchaseQty; /** * 物料规格 @@ -66,7 +68,7 @@ public class WmsPurchaseOrderDetailBo extends BaseEntity { /** * 送货数量=送货单数量=总入库数量 */ - private Long deliveryQty; + private BigDecimal deliveryQty; private Long materialId; diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/BaseSupplierInfoVo.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/BaseSupplierInfoVo.java new file mode 100644 index 00000000..151f1f02 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/domain/vo/BaseSupplierInfoVo.java @@ -0,0 +1,116 @@ +package org.dromara.wms.domain.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.github.linpeilie.annotations.AutoMapper; +import lombok.Data; +import org.dromara.common.excel.annotation.ExcelDictFormat; +import org.dromara.common.excel.convert.ExcelDictConvert; +import org.dromara.wms.domain.BaseSupplierInfo; + +import java.io.Serial; +import java.io.Serializable; +import java.util.Date; + + +/** + * 供应商信息视图对象 base_supplier_info + * + * @author ZangCH + * @date 2025-01-07 + */ +@Data +@ExcelIgnoreUnannotated +@AutoMapper(target = BaseSupplierInfo.class) +public class BaseSupplierInfoVo implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + @ExcelProperty(value = "主键标识") + private Long supplierId; + + /** + * 租户编号 + */ + @ExcelProperty(value = "租户编号") + private String tenantId; + + /** + * 供应商编号 + */ + @ExcelProperty(value = "供应商编号") + private String supplierCode; + + /** + * 供应商名称 + */ + @ExcelProperty(value = "供应商名称") + private String supplierName; + + /** + * erp的主键 + */ + @ExcelProperty(value = "erp的主键") + private Long erpId; + + /** + * 激活状态(1启用 0停用) + */ + @ExcelProperty(value = "激活状态", converter = ExcelDictConvert.class) + @ExcelDictFormat(dictType = "active_flag") + private String supplierStatus; + + /** + * 审核日期 + */ + @ExcelProperty(value = "审核日期") + private Date auditDate; + + /** + * erp最后更新时间 + */ + @ExcelProperty(value = "erp最后更新时间") + private Date erpModifyDate; + + /** + * 备注 + */ + @ExcelProperty(value = "备注") + private String remark; + + /** + * 创建部门 + */ + @ExcelProperty(value = "创建部门") + private Long createDept; + + /** + * 创建人 + */ + @ExcelProperty(value = "创建人") + private Long createBy; + + /** + * 创建时间 + */ + @ExcelProperty(value = "创建时间") + private Date createTime; + + /** + * 更新人 + */ + @ExcelProperty(value = "更新人") + private Long updateBy; + + /** + * 更新时间 + */ + @ExcelProperty(value = "更新时间") + private Date updateTime; + + +} 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 index 16a74e90..5df46354 100644 --- 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 @@ -10,6 +10,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; @@ -62,13 +63,13 @@ public class WmsPurchaseOrderDetailVo implements Serializable { * 含税单价 */ @ExcelProperty(value = "含税单价") - private Long taxPrice; + private BigDecimal taxPrice; /** * 采购数量 */ @ExcelProperty(value = "采购数量") - private Long purchaseQty; + private BigDecimal purchaseQty; /** * 物料规格 @@ -86,7 +87,7 @@ public class WmsPurchaseOrderDetailVo implements Serializable { * 送货数量=送货单数量=总入库数量 */ @ExcelProperty(value = "送货数量=送货单数量=总入库数量") - private Long deliveryQty; + private BigDecimal deliveryQty; /** * 租户号 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 index 109f8d3d..89a042b9 100644 --- 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 @@ -141,6 +141,10 @@ public class WmsPurchaseOrderVo implements Serializable { */ @ExcelProperty(value = "审核意见") private String auditComments; + /** + * 供应商编号 + */ + private String supplierCode; } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/BaseSupplierInfoMapper.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/BaseSupplierInfoMapper.java new file mode 100644 index 00000000..28b074d1 --- /dev/null +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/mapper/BaseSupplierInfoMapper.java @@ -0,0 +1,15 @@ +package org.dromara.wms.mapper; + +import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; +import org.dromara.wms.domain.BaseSupplierInfo; +import org.dromara.wms.domain.vo.BaseSupplierInfoVo; + +/** + * 供应商信息Mapper接口 + * + * @author ZangCH + * @date 2025-01-07 + */ +public interface BaseSupplierInfoMapper extends BaseMapperPlus { + +} diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryCheckRecordServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryCheckRecordServiceImpl.java index 8e884c7f..80c6c9bd 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryCheckRecordServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsInventoryCheckRecordServiceImpl.java @@ -79,8 +79,8 @@ public class WmsInventoryCheckRecordServiceImpl implements IWmsInventoryCheckRec .eq(StringUtils.isNotBlank(bo.getCheckCode()), WmsInventoryCheckRecord::getCheckCode, bo.getCheckCode()) .eq(StringUtils.isNotBlank(bo.getBatchCode()), WmsInventoryCheckRecord::getBatchCode, bo.getBatchCode()) .eq(bo.getMaterialId() != null, WmsInventoryCheckRecord::getMaterialId, bo.getMaterialId()) - .eq(StringUtils.isNotBlank(bo.getLocationCode()), WmsInventoryCheckRecord::getLocationCode, bo.getLocationCode()) - .eq(StringUtils.isNotBlank(bo.getMaterialCode()), WmsInventoryCheckRecord::getMaterialCode, bo.getMaterialCode()) + .like(StringUtils.isNotBlank(bo.getLocationCode()), WmsInventoryCheckRecord::getLocationCode, bo.getLocationCode()) + .like(StringUtils.isNotBlank(bo.getMaterialCode()), WmsInventoryCheckRecord::getMaterialCode, bo.getMaterialCode()) .like(StringUtils.isNotBlank(bo.getMaterialName()), WmsInventoryCheckRecord::getMaterialName, bo.getMaterialName()) .eq(StringUtils.isNotBlank(bo.getInventoryQty()), WmsInventoryCheckRecord::getInventoryQty, bo.getInventoryQty()) .eq(bo.getCheckQty() != null, WmsInventoryCheckRecord::getCheckQty, bo.getCheckQty()) diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsMoveOrderServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsMoveOrderServiceImpl.java index 02cc091a..dc681a8b 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsMoveOrderServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsMoveOrderServiceImpl.java @@ -92,9 +92,9 @@ public class WmsMoveOrderServiceImpl implements IWmsMoveOrderService { .eq(bo.getMaterialId() != null, WmsMoveOrder::getMaterialId, bo.getMaterialId()) .eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsMoveOrder::getMaterialCategories, bo.getMaterialCategories()) .eq(bo.getWarehouseId() != null, WmsMoveOrder::getWarehouseId, bo.getWarehouseId()) - .eq(bo.getPlanLocationCode() != null, WmsMoveOrder::getPlanLocationCode, bo.getPlanLocationCode()) + .like(bo.getPlanLocationCode() != null, WmsMoveOrder::getPlanLocationCode, bo.getPlanLocationCode()) .eq(StringUtils.isNotBlank(bo.getOrderStatus()), WmsMoveOrder::getOrderStatus, bo.getOrderStatus()) - .eq(bo.getTargetLocationCode() != null, WmsMoveOrder::getTargetLocationCode, bo.getTargetLocationCode()) + .like(bo.getTargetLocationCode() != null, WmsMoveOrder::getTargetLocationCode, bo.getTargetLocationCode()) .eq(StringUtils.isNotBlank(bo.getAuditBy()), WmsMoveOrder::getAuditBy, bo.getAuditBy()) .eq(bo.getAuditTime() != null, WmsMoveOrder::getAuditTime, bo.getAuditTime()) .eq(StringUtils.isNotBlank(bo.getAuditStatus()), WmsMoveOrder::getAuditStatus, bo.getAuditStatus()) 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 index bb1ccf85..909fb30b 100644 --- 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 @@ -1,5 +1,6 @@ package org.dromara.wms.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -9,6 +10,11 @@ import com.github.yulichang.toolkit.JoinWrappers; import com.github.yulichang.wrapper.MPJLambdaWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import lombok.RequiredArgsConstructor; +import org.dromara.common.satoken.utils.LoginHelper; +import org.dromara.wms.domain.BaseSupplierInfo; +import org.dromara.wms.domain.WmsInstockOrder; +import org.dromara.wms.domain.vo.WmsInstockOrderVo; +import org.dromara.wms.mapper.WmsInstockOrderMapper; import org.springframework.stereotype.Service; import org.dromara.wms.domain.bo.WmsPurchaseOrderBo; import org.dromara.wms.domain.vo.WmsPurchaseOrderVo; @@ -16,9 +22,12 @@ import org.dromara.wms.domain.WmsPurchaseOrder; import org.dromara.wms.mapper.WmsPurchaseOrderMapper; import org.dromara.wms.service.IWmsPurchaseOrderService; +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业务层处理 @@ -31,6 +40,10 @@ import java.util.Collection; public class WmsPurchaseOrderServiceImpl implements IWmsPurchaseOrderService { private final WmsPurchaseOrderMapper baseMapper; + private static final AtomicInteger sequence = new AtomicInteger(0); + public static Integer nextSequence() { + return sequence.incrementAndGet(); + } /** * 查询采购订单 @@ -73,6 +86,8 @@ public class WmsPurchaseOrderServiceImpl implements IWmsPurchaseOrderService { Map params = bo.getParams(); MPJLambdaWrapper lqw = JoinWrappers.lambda(WmsPurchaseOrder.class) .selectAll(WmsPurchaseOrder.class) + .select(BaseSupplierInfo::getSupplierCode) + .leftJoin(BaseSupplierInfo.class,BaseSupplierInfo::getSupplierId,WmsPurchaseOrder::getSupplierId) .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()) @@ -96,14 +111,39 @@ public class WmsPurchaseOrderServiceImpl implements IWmsPurchaseOrderService { */ @Override public WmsPurchaseOrder insertByBo(WmsPurchaseOrderBo bo) { + String username = LoginHelper.getUsername(); + Date date = new Date(); + SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHssmm"); + String orderDate = format.format(date); + String order = "PUR"; + String orderLast=""; + Integer value = nextSequence(); + if (value.toString().length()==4){ + sequence.set(1); + orderLast = generateOrder(sequence.get()); + }else { + orderLast = generateOrder(value); + } + String purOrder = order + orderDate + orderLast; WmsPurchaseOrder add = MapstructUtils.convert(bo, WmsPurchaseOrder.class); validEntityBeforeSave(add); + add.setPoNo(purOrder); + add.setCreateBy(username); boolean flag = baseMapper.insert(add) > 0; if (flag) { bo.setPoId(add.getPoId()); } return add; } + 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(); + } /** * 修改采购订单 @@ -114,6 +154,8 @@ public class WmsPurchaseOrderServiceImpl implements IWmsPurchaseOrderService { @Override public Boolean updateByBo(WmsPurchaseOrderBo bo) { WmsPurchaseOrder update = MapstructUtils.convert(bo, WmsPurchaseOrder.class); + String username = LoginHelper.getUsername(); + update.setUpdateBy(username); validEntityBeforeSave(update); return baseMapper.updateById(update) > 0; } diff --git a/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsInventoryMapper.xml b/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsInventoryMapper.xml index 6ac278df..d2052478 100644 --- a/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsInventoryMapper.xml +++ b/ruoyi-modules/hwmom-wms/src/main/resources/mapper/wms/WmsInventoryMapper.xml @@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" MAX(b.min_stock_amount) min_stock_amount, MAX(b.max_stock_amount) max_stock_amount, MAX(c.warehouse_code) warehouse_code, - MAX(d.material_code) material_code, + MAX(b.material_code) material_code, MAX(x.lock_state) lock_state, MAX(x.inventory_status) inventory_status, MAX(x.material_categories) material_categories, @@ -34,12 +34,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" x.material_id = b.material_id left join wms_base_warehouse c on x.warehouse_id = c.warehouse_id - left join base_material_info d - on - x.material_id = d.material_id +-- left join base_material_info d +-- on +-- x.material_id = d.material_id - and x.material_id = #{entity.materialId} + and x.warehouse_id = #{entity.warehouseId} + and x.lock_state = #{entity.lockState} + and x.material_categories = #{entity.materialCategories} + and x.inventory_status = #{entity.inventoryStatus} + and x.location_code like concat('%',#{entity.locationCode},'%') + and x.batch_code like concat('%',#{entity.batchCode},'%') + and x.material_code like concat('%',#{entity.materialCode},'%') group by x.warehouse_id ,