| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -12,6 +12,7 @@ import com.hnac.hzinfo.inspect.ai.service.IZhiPuBigModelService; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.hnac.hzinfo.inspect.ai.vo.ZhiPuImageAnalysisDTO; | 
					 | 
					 | 
					 | 
					import com.hnac.hzinfo.inspect.ai.vo.ZhiPuImageAnalysisDTO; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import com.hnac.hzinfo.inspect.utils.HiKUtil; | 
					 | 
					 | 
					 | 
					import com.hnac.hzinfo.inspect.utils.HiKUtil; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import lombok.AllArgsConstructor; | 
					 | 
					 | 
					 | 
					import lombok.AllArgsConstructor; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import org.springblade.core.tool.api.R; | 
					 | 
					 | 
					 | 
					import org.springblade.core.tool.api.R; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import org.springblade.core.tool.utils.CollectionUtil; | 
					 | 
					 | 
					 | 
					import org.springblade.core.tool.utils.CollectionUtil; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import org.springblade.core.tool.utils.StringUtil; | 
					 | 
					 | 
					 | 
					import org.springblade.core.tool.utils.StringUtil; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -21,6 +22,8 @@ import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import java.util.ArrayList; | 
					 | 
					 | 
					 | 
					import java.util.ArrayList; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import java.util.List; | 
					 | 
					 | 
					 | 
					import java.util.List; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import java.util.Map; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					import java.util.concurrent.ConcurrentHashMap; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					import java.util.stream.Collectors; | 
					 | 
					 | 
					 | 
					import java.util.stream.Collectors; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					/** | 
					 | 
					 | 
					 | 
					/** | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -29,6 +32,7 @@ import java.util.stream.Collectors; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 */ | 
					 | 
					 | 
					 | 
					 */ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					@Service | 
					 | 
					 | 
					 | 
					@Service | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					@AllArgsConstructor | 
					 | 
					 | 
					 | 
					@AllArgsConstructor | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					@Slf4j | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					public class ZhiPuBigModelServiceImpl implements IZhiPuBigModelService { | 
					 | 
					 | 
					 | 
					public class ZhiPuBigModelServiceImpl implements IZhiPuBigModelService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private final IStationVideoTypeClient stationVideoTypeClient; | 
					 | 
					 | 
					 | 
					    private final IStationVideoTypeClient stationVideoTypeClient; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -59,7 +63,6 @@ public class ZhiPuBigModelServiceImpl implements IZhiPuBigModelService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (StringUtil.isBlank(url)) { | 
					 | 
					 | 
					 | 
					            if (StringUtil.isBlank(url)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                continue; | 
					 | 
					 | 
					 | 
					                continue; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            BigModelAnalysisRequestDTO zhiPuRequest = new BigModelAnalysisRequestDTO(); | 
					 | 
					 | 
					 | 
					            BigModelAnalysisRequestDTO zhiPuRequest = new BigModelAnalysisRequestDTO(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            zhiPuRequest.setUrl(url); | 
					 | 
					 | 
					 | 
					            zhiPuRequest.setUrl(url); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            zhiPuRequest.setCheckTypeSonList(analysisTypeList); | 
					 | 
					 | 
					 | 
					            zhiPuRequest.setCheckTypeSonList(analysisTypeList); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -85,23 +88,35 @@ public class ZhiPuBigModelServiceImpl implements IZhiPuBigModelService { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    public List<String> getZhiPuAnalysisType(String[] originalCode) { | 
					 | 
					 | 
					 | 
					    public List<String> getZhiPuAnalysisType(String[] originalCode) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        List<String> result = new ArrayList<>(); | 
					 | 
					 | 
					 | 
					        List<String> result = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        R<List<Dict>> zhiPuResponse = dictClient.getList(ZHI_PU_TYPE_KEY); | 
					 | 
					 | 
					 | 
					        Map<String, String> typeMap = mappingTypes(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (!zhiPuResponse.isSuccess()) { | 
					 | 
					 | 
					 | 
					        for (String code : originalCode) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            String zhiPuType = typeMap.get(code); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (StringUtil.isNotBlank(zhiPuType)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                result.add(zhiPuType); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return result; | 
					 | 
					 | 
					 | 
					        return result; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        List<Dict> zhiPuList = zhiPuResponse.getData(); | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        for (String code : originalCode) { | 
					 | 
					 | 
					 | 
					    public Map<String, String> mappingTypes() { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            R<String> valueResponse = dictClient.getValue(CAMERA_TYPE_KEY, code); | 
					 | 
					 | 
					 | 
					        Map<String, String> typeMap = new ConcurrentHashMap<>(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (!valueResponse.isSuccess()|| StringUtil.isBlank(valueResponse.getData())) { | 
					 | 
					 | 
					 | 
					        R<List<Dict>> zhiPuResponse = dictClient.getList(ZHI_PU_TYPE_KEY); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                continue; | 
					 | 
					 | 
					 | 
					        if (!zhiPuResponse.isSuccess() || CollectionUtil.isEmpty(zhiPuResponse.getData())) { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            return typeMap; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            String value = valueResponse.getData(); | 
					 | 
					 | 
					 | 
					        R<List<Dict>> cameraResponse = dictClient.getList(CAMERA_TYPE_KEY); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            for (Dict dict : zhiPuList) { | 
					 | 
					 | 
					 | 
					        if (!cameraResponse.isSuccess() || CollectionUtil.isEmpty(cameraResponse.getData())) { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                if (value.indexOf(dict.getDictValue()) >= 0 || dict.getDictValue().indexOf(value) >= 0) { | 
					 | 
					 | 
					 | 
					            return typeMap; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    result.add(dict.getDictKey()); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        } | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<Dict> zhiPuList = zhiPuResponse.getData(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<Dict> cameraList = cameraResponse.getData(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        for (Dict camera : cameraList) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            for (Dict zhiPu : zhiPuList) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                if (camera.getDictValue().indexOf(zhiPu.getDictValue()) >= 0 || zhiPu.getDictValue().indexOf(camera.getDictValue()) >= 0) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                    typeMap.put(camera.getDictKey(), zhiPu.getDictKey()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return result; | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        return typeMap; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    } | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					} | 
					 | 
					 | 
					 | 
					} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					 | 
					
  |