|  |  | @ -14,11 +14,13 @@ import com.glxp.api.entity.thrsys.CodeRel; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.enums.led.LedColorStatusEnum; |  |  |  | import com.glxp.api.enums.led.LedColorStatusEnum; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.exception.JsonException; |  |  |  | import com.glxp.api.exception.JsonException; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.req.collect.CollectLedGroupRequest; |  |  |  | import com.glxp.api.req.collect.CollectLedGroupRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import com.glxp.api.req.collect.LedGroupRequest; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.res.collect.IoCollectLedGroupResponse; |  |  |  | import com.glxp.api.res.collect.IoCollectLedGroupResponse; | 
			
		
	
		
		
			
				
					
					|  |  |  | import com.glxp.api.util.OkHttpCli; |  |  |  | import com.glxp.api.util.OkHttpCli; | 
			
		
	
		
		
			
				
					
					|  |  |  | import org.springframework.stereotype.Service; |  |  |  | import org.springframework.stereotype.Service; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | import javax.annotation.Resource; |  |  |  | import javax.annotation.Resource; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | import java.util.ArrayList; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.Collections; |  |  |  | import java.util.Collections; | 
			
		
	
		
		
			
				
					
					|  |  |  | import java.util.List; |  |  |  | import java.util.List; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  |  | @ -50,21 +52,25 @@ public class IoCollectLedGroupService extends ServiceImpl<IoCollectLedGroupMappe | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     public BaseResponse<String> openLed(IoCollectOrderBiz collectOrderBiz) { |  |  |  |     public BaseResponse<String> openLed(List<IoCollectOrderBiz> collectOrderBizs) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         IoCollectLedGroup one = getOne(new LambdaQueryWrapper<IoCollectLedGroup>().eq(IoCollectLedGroup::getRelId, collectOrderBiz.getRelId())); |  |  |  |         LedGroupRequest ledGroupRequest = new LedGroupRequest(); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         if (one == null){ |  |  |  |         for (IoCollectOrderBiz collectOrderBiz :  collectOrderBizs){ | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             throw new JsonException(500,"当前产品未绑定灯组"); |  |  |  |             IoCollectLedGroup one = getOne(new LambdaQueryWrapper<IoCollectLedGroup>().eq(IoCollectLedGroup::getRelId, collectOrderBiz.getRelId())); | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (one == null){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 throw new JsonException(500,"当前产品未绑定灯组"); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             CollectLedGroupRequest collectLedGroupRequest = new CollectLedGroupRequest(); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             collectLedGroupRequest.setMac(one.getMac()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             collectLedGroupRequest.setTimeout(one.getTimeout()); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             if (one.getLedMode()){ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 collectLedGroupRequest.setLedmode(1); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             }else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 collectLedGroupRequest.setLedmode(0); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             collectLedGroupRequest.setLednum(setLedNum(one)); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ledGroupRequest.getData().add(collectLedGroupRequest); | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         CollectLedGroupRequest collectLedGroupRequest = new CollectLedGroupRequest(); |  |  |  |         String json = JSONUtil.toJsonStr(ledGroupRequest); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         collectLedGroupRequest.setMac(one.getMac()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         collectLedGroupRequest.setTimeout(one.getTimeout()); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         if (one.getLedMode()){ |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             collectLedGroupRequest.setLedmode(1); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         }else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             collectLedGroupRequest.setLedmode(0); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         collectLedGroupRequest.setLednum(setLedNum(one)); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         String json = JSONUtil.toJsonStr(collectLedGroupRequest); |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |         String result = okHttpCli.doPostJson( "http://192.168.0.166:9099/wms/associate/lighttagsled", json); |  |  |  |         String result = okHttpCli.doPostJson( "http://192.168.0.166:9099/wms/associate/lighttagsled", json); | 
			
		
	
		
		
			
				
					
					|  |  |  |         BaseResponse<String> response = |  |  |  |         BaseResponse<String> response = | 
			
		
	
		
		
			
				
					
					|  |  |  |                 JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() { |  |  |  |                 JSONObject.parseObject(result, new TypeReference<BaseResponse<String>>() { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |