|  |  |  | @ -7,9 +7,15 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
			
		
	
		
			
				
					|  |  |  |  | import com.github.pagehelper.PageHelper; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.dao.auth.SysWorkplaceDao; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.auth.SysWorkplace; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.exception.JsonException; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.auth.SysWorkplaceRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.basic.WorkBindBusTypeRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.res.basic.SysWorkplaceDocumentResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.res.basic.SysWorkplaceResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.basic.SysWorkplaceDocumentService; | 
			
		
	
		
			
				
					|  |  |  |  | import org.apache.poi.ss.formula.functions.Offset; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.transaction.annotation.Transactional; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import javax.annotation.Resource; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.Collections; | 
			
		
	
	
		
			
				
					|  |  |  | @ -25,6 +31,9 @@ public class SysWorkplaceService extends ServiceImpl<SysWorkplaceDao, SysWorkpla | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     SysWorkplaceDao sysWorkplaceDao; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     private SysWorkplaceDocumentService sysWorkplaceDocumentService; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     public Long maxWorkplaceId() { | 
			
		
	
		
			
				
					|  |  |  |  |         return super.baseMapper.selectMaxWorkplaceId(); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
	
		
			
				
					|  |  |  | @ -53,4 +62,23 @@ public class SysWorkplaceService extends ServiceImpl<SysWorkplaceDao, SysWorkpla | 
			
		
	
		
			
				
					|  |  |  |  | //        return super.baseMapper.selectList(
 | 
			
		
	
		
			
				
					|  |  |  |  | //                new LambdaQueryWrapper<SysWorkplace>().eq(SysWorkplace::getOrderId, code));
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Transactional(rollbackFor = Exception.class) | 
			
		
	
		
			
				
					|  |  |  |  |     public boolean updateWorkplace(SysWorkplace sysWorkplace) { | 
			
		
	
		
			
				
					|  |  |  |  |         if (sysWorkplace.getWorkplaceStatus() == 0 ){ | 
			
		
	
		
			
				
					|  |  |  |  |             //更改停用 判断是否含有工位类型
 | 
			
		
	
		
			
				
					|  |  |  |  |             WorkBindBusTypeRequest request = new WorkBindBusTypeRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |             request.setWorkplaceCode(sysWorkplace.getWorkplaceId()); | 
			
		
	
		
			
				
					|  |  |  |  |             List<SysWorkplaceDocumentResponse> page = sysWorkplaceDocumentService.filterListByWorkplace(request); | 
			
		
	
		
			
				
					|  |  |  |  |             if (page != null || page.size() >0 ){ | 
			
		
	
		
			
				
					|  |  |  |  |                 throw new JsonException(500,"当前工位已作业,请解绑之后暂停工位"); | 
			
		
	
		
			
				
					|  |  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         boolean b = this.updateById(sysWorkplace); | 
			
		
	
		
			
				
					|  |  |  |  |         if (!b){ | 
			
		
	
		
			
				
					|  |  |  |  |             return false; | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |         return true; | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | } | 
			
		
	
	
		
			
				
					|  |  |  | 
 |