|
|
|
|
@ -15,16 +15,15 @@ import org.dromara.wms.domain.BaseMaterialCategory;
|
|
|
|
|
import org.dromara.wms.domain.WmsAllocateOrder;
|
|
|
|
|
import org.dromara.wms.domain.WmsBaseWarehouse;
|
|
|
|
|
import org.dromara.wms.domain.bo.WmsAllocateOrderBo;
|
|
|
|
|
import org.dromara.wms.domain.vo.WmsAllocateOrderDetailVo;
|
|
|
|
|
import org.dromara.wms.domain.vo.WmsAllocateOrderVo;
|
|
|
|
|
import org.dromara.wms.mapper.WmsAllocateOrderMapper;
|
|
|
|
|
import org.dromara.wms.service.IWmsAllocateOrderService;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -43,6 +42,8 @@ public class WmsAllocateOrderServiceImpl implements IWmsAllocateOrderService {
|
|
|
|
|
return sequence.incrementAndGet();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private final WmsAllocateOrderDetailServiceImpl wmsAllocateOrderDetailService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 查询调拨工单
|
|
|
|
|
@ -218,10 +219,25 @@ public class WmsAllocateOrderServiceImpl implements IWmsAllocateOrderService {
|
|
|
|
|
* @return 是否删除成功
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
|
if(isValid){
|
|
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
|
}
|
|
|
|
|
for (Long id : ids){
|
|
|
|
|
//要被删除的子表集合
|
|
|
|
|
List<Long> detailIds = new ArrayList<>();
|
|
|
|
|
//查询主表
|
|
|
|
|
WmsAllocateOrderVo allocateOrder = queryById(id);
|
|
|
|
|
//该主表的子表集合
|
|
|
|
|
List<WmsAllocateOrderDetailVo> allocateOrderDetailVos = wmsAllocateOrderDetailService.selectdetailListByOrderCode(allocateOrder.getAllocateOrderCode());
|
|
|
|
|
if (!allocateOrderDetailVos.isEmpty()) {//子表集合不为空
|
|
|
|
|
for (WmsAllocateOrderDetailVo allocateOrderDetailVo : allocateOrderDetailVos){
|
|
|
|
|
detailIds.add(allocateOrderDetailVo.getAoDId());
|
|
|
|
|
}
|
|
|
|
|
wmsAllocateOrderDetailService.deleteWithValidByIds(detailIds,true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|