|  |  | @ -2,9 +2,12 @@ package com.glxp.sale.admin.service.thrsys.impl; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.github.pagehelper.PageHelper; |  |  |  | import com.github.pagehelper.PageHelper; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.sale.admin.dao.thrsys.ThrInvWarehouseDao; |  |  |  | import com.glxp.sale.admin.dao.thrsys.ThrInvWarehouseDao; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.sale.admin.dao.thrsys.ThrSubInvWarehouseDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.sale.admin.entity.thrsys.ThrInvWarehouseEntity; |  |  |  | import com.glxp.sale.admin.entity.thrsys.ThrInvWarehouseEntity; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.sale.admin.req.thrsys.FilterThrInvWarehouseRequest; |  |  |  | import com.glxp.sale.admin.req.thrsys.FilterThrInvWarehouseRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.sale.admin.service.thrsys.ThrInvWarehouseService; |  |  |  | import com.glxp.sale.admin.service.thrsys.ThrInvWarehouseService; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.sale.common.res.BaseResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.sale.common.util.ResultVOUtils; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.stereotype.Service; |  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import javax.annotation.Resource; |  |  |  | import javax.annotation.Resource; | 
			
		
	
	
		
		
			
				
					|  |  | @ -16,7 +19,9 @@ public class ThrInvWarehouseServiceImpl implements ThrInvWarehouseService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Resource |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |     ThrInvWarehouseDao thrInvWarehouseDao; |  |  |  |     private ThrInvWarehouseDao thrInvWarehouseDao; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Resource | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     private ThrSubInvWarehouseDao thrSubInvWarehouseDao; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |     public ThrInvWarehouseEntity findDefault(Boolean advaceType, Boolean isDefault) { |  |  |  |     public ThrInvWarehouseEntity findDefault(Boolean advaceType, Boolean isDefault) { | 
			
		
	
	
		
		
			
				
					|  |  | @ -86,6 +91,11 @@ public class ThrInvWarehouseServiceImpl implements ThrInvWarehouseService { | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     @Override |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |     public boolean deleteById(String id) { |  |  |  |     public boolean deleteById(String id) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //查询有无子仓库
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         int count = thrSubInvWarehouseDao.countSubInvByParentInvId(id); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (count > 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return false; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         return thrInvWarehouseDao.deleteById(id); |  |  |  |         return thrInvWarehouseDao.deleteById(id); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -93,4 +103,14 @@ public class ThrInvWarehouseServiceImpl implements ThrInvWarehouseService { | 
			
		
	
		
		
			
				
					
					|  |  |  |     public ThrInvWarehouseEntity selectMaxCode(FilterThrInvWarehouseRequest filterThrInvWarehouseRequest) { |  |  |  |     public ThrInvWarehouseEntity selectMaxCode(FilterThrInvWarehouseRequest filterThrInvWarehouseRequest) { | 
			
		
	
		
		
			
				
					
					|  |  |  |         return thrInvWarehouseDao.selectMaxCode(filterThrInvWarehouseRequest); |  |  |  |         return thrInvWarehouseDao.selectMaxCode(filterThrInvWarehouseRequest); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     @Override | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     public BaseResponse deleteInvById(String id) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         //查询有无子仓库
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         int count = thrSubInvWarehouseDao.countSubInvByParentInvId(id); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         if (count > 0) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return ResultVOUtils.error(500, "请先删除子仓库!"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return ResultVOUtils.success("删除成功"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |