|
@@ -3,7 +3,12 @@ package com.ruoyi.basicData.service.impl;
|
|
|
import com.ruoyi.basicData.domain.TWarehouseArea;
|
|
|
import com.ruoyi.basicData.mapper.TWarehouseAreaMapper;
|
|
|
import com.ruoyi.basicData.service.ITWarehouseAreaService;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.TWarehouseBills;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.TWarehousebillsitems;
|
|
|
+import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
|
|
|
+import com.ruoyi.warehouseBusiness.mapper.TWarehousebillsitemsMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -20,6 +25,10 @@ public class TWarehouseAreaServiceImpl implements ITWarehouseAreaService {
|
|
|
@Autowired
|
|
|
private TWarehouseAreaMapper tWarehouseAreaMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TWarehousebillsitemsMapper tWarehousebillsitemsMapper;
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 查询库区
|
|
|
*
|
|
@@ -69,12 +78,22 @@ public class TWarehouseAreaServiceImpl implements ITWarehouseAreaService {
|
|
|
/**
|
|
|
* 批量删除库区
|
|
|
*
|
|
|
- * @param fIds 需要删除的库区ID
|
|
|
+ * @param fId 需要删除的库区ID
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@Override
|
|
|
- public int deleteTWarehouseAreaByIds(Long[] fIds) {
|
|
|
- return tWarehouseAreaMapper.deleteTWarehouseAreaByIds(fIds);
|
|
|
+ public AjaxResult deleteTWarehouseAreaByIds(Long[] fId) {
|
|
|
+ // tWarehouseAreaMapper.deleteTWarehouseAreaByIds(fId);
|
|
|
+ for(Long id:fId){
|
|
|
+ TWarehousebillsitems tWarehousebillsitems =new TWarehousebillsitems();
|
|
|
+ tWarehousebillsitems.setfWarehouselocid(id);
|
|
|
+ List<TWarehousebillsitems> warehousebillsitemsList1 =tWarehousebillsitemsMapper.selectTWarehousebillsitemsList(tWarehousebillsitems);
|
|
|
+ if(warehousebillsitemsList1!=null && !warehousebillsitemsList1.isEmpty()){
|
|
|
+ return AjaxResult.error("库区有货物不可删除");
|
|
|
+ }
|
|
|
+ tWarehouseAreaMapper.deleteTWarehouseAreaById(id);
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
/**
|