diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsOutstockDetailController.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsOutstockDetailController.java index 141567dd..557a3f65 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsOutstockDetailController.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/controller/WmsOutstockDetailController.java @@ -108,6 +108,11 @@ public class WmsOutstockDetailController extends BaseController { return toAjax(wmsOutstockDetailService.deleteWithValidByIds(List.of(outstockDetailIds), true)); } + /** + * 根据出库明细id删除 + * @param outstockDetailId + * @return + */ @SaCheckPermission("system:outstockDetail:remove") @Log(title = "出库单-物料", businessType = BusinessType.DELETE) @DeleteMapping("detailRemove/{outstockDetailId}") diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsOutstockDetailService.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsOutstockDetailService.java index c68f39e1..11e929e7 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsOutstockDetailService.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/IWmsOutstockDetailService.java @@ -66,6 +66,7 @@ public interface IWmsOutstockDetailService { * @return 是否删除成功 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + int deleteByOutstockId(Collection ids, Boolean isValid); int deleteById(Long outstockDetailId); } 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 index 3eb6f5b5..8c41cd5a 100644 --- 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 @@ -66,4 +66,6 @@ public interface IWmsPurchaseOrderDetailService { * @return 是否删除成功 */ Boolean deleteWithValidByIds(Collection ids, Boolean isValid); + + int deleteByPos(Collection pos, Boolean isValid); } diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockDetailServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockDetailServiceImpl.java index 58069985..e684ddf4 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockDetailServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockDetailServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.wms.service.impl; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.github.yulichang.toolkit.JoinWrappers; import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.dromara.common.core.utils.MapstructUtils; @@ -162,6 +163,13 @@ public class WmsOutstockDetailServiceImpl implements IWmsOutstockDetailService { return baseMapper.deleteById(outstockDetailId); } + @Override + public int deleteByOutstockId(Collection ids, Boolean isValid) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper.in(WmsOutstockDetail::getOutstockId,ids); + return baseMapper.delete(wrapper); + } + /** * 校验并批量删除出库单-物料信息 * diff --git a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockOrderServiceImpl.java b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockOrderServiceImpl.java index ef5eca8c..19edd365 100644 --- a/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockOrderServiceImpl.java +++ b/ruoyi-modules/hwmom-wms/src/main/java/org/dromara/wms/service/impl/WmsOutstockOrderServiceImpl.java @@ -20,8 +20,11 @@ import org.dromara.wms.domain.bo.WmsOutstockOrderBo; import org.dromara.wms.domain.vo.WmsOutstockOrderVo; import org.dromara.wms.mapper.WmsInstockOrderMapper; import org.dromara.wms.mapper.WmsOutstockOrderMapper; +import org.dromara.wms.service.IWmsOutstockDetailService; import org.dromara.wms.service.IWmsOutstockOrderService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.util.Date; @@ -45,6 +48,8 @@ public class WmsOutstockOrderServiceImpl implements IWmsOutstockOrderService { public static Integer nextSequence() { return sequence.incrementAndGet(); } + @Autowired + private IWmsOutstockDetailService wmsOutstockDetailService; /** * 查询出库单 @@ -194,10 +199,13 @@ public class WmsOutstockOrderServiceImpl implements IWmsOutstockOrderService { * @return 是否删除成功 */ @Override + @Transactional public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { if(isValid){ //TODO 做一些业务上的校验,判断是否需要校验 } - return baseMapper.deleteByIds(ids) > 0; + int delete = baseMapper.deleteByIds(ids); + int count = wmsOutstockDetailService.deleteByOutstockId(ids, isValid); + return delete > 0; } } 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 index d7f7e691..8b650934 100644 --- 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 @@ -1,5 +1,6 @@ package org.dromara.wms.service.impl; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.StringUtils; import org.dromara.common.mybatis.core.page.TableDataInfo; @@ -140,6 +141,14 @@ public class WmsPurchaseOrderDetailServiceImpl implements IWmsPurchaseOrderDetai //TODO 做一些数据校验,如唯一约束 } + @Override + public int deleteByPos(Collection pos, Boolean isValid) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper.in(WmsPurchaseOrderDetail::getPoNo,pos); + int delete = baseMapper.delete(wrapper); + return delete; + } + /** * 校验并批量删除采购订单-物料信息 * 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 909fb30b..1972601d 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 @@ -15,6 +15,8 @@ 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.dromara.wms.service.IWmsPurchaseOrderDetailService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.dromara.wms.domain.bo.WmsPurchaseOrderBo; import org.dromara.wms.domain.vo.WmsPurchaseOrderVo; @@ -44,6 +46,8 @@ public class WmsPurchaseOrderServiceImpl implements IWmsPurchaseOrderService { public static Integer nextSequence() { return sequence.incrementAndGet(); } + @Autowired + private IWmsPurchaseOrderDetailService wmsPurchaseOrderDetailService; /** * 查询采购订单