|  |  |  | @ -1,16 +1,17 @@ | 
			
		
	
		
			
				
					|  |  |  |  | package com.glxp.api.controller.basic; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import cn.hutool.core.collection.CollUtil; | 
			
		
	
		
			
				
					|  |  |  |  | import cn.hutool.core.util.StrUtil; | 
			
		
	
		
			
				
					|  |  |  |  | import com.github.pagehelper.PageInfo; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.annotation.AuthRuleAnnotation; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.res.BaseResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.common.util.ResultVOUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.entity.basic.*; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.basic.FilterUdiRelRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.basic.ProductInfoFilterRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.basic.UdiCompanyRequest; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.http.sync.SpGetHttpClient; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.req.basic.*; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.res.PageSimpleResponse; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.service.basic.*; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.util.OkHttpCli; | 
			
		
	
		
			
				
					|  |  |  |  | import com.glxp.api.util.udi.FilterUdiUtils; | 
			
		
	
		
			
				
					|  |  |  |  | import lombok.extern.slf4j.Slf4j; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.beans.BeanUtils; | 
			
		
	
	
		
			
				
					|  |  |  | @ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.GetMapping; | 
			
		
	
		
			
				
					|  |  |  |  | import org.springframework.web.bind.annotation.RestController; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | import javax.annotation.Resource; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.ArrayList; | 
			
		
	
		
			
				
					|  |  |  |  | import java.util.List; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | /** | 
			
		
	
	
		
			
				
					|  |  |  | @ -33,6 +35,11 @@ public class UdiSyncController { | 
			
		
	
		
			
				
					|  |  |  |  |     UdiProductService udiProductService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     SyncUdiService syncUdiService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     ProductInfoService productInfoService; | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     UdiCompanyService udiCompanyService; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     //获取同步库UDI信息
 | 
			
		
	
		
			
				
					|  |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
	
		
			
				
					|  |  |  | @ -105,7 +112,30 @@ public class UdiSyncController { | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @Resource | 
			
		
	
		
			
				
					|  |  |  |  |     SpGetHttpClient spGetHttpClient; | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
		
			
				
					|  |  |  |  |     @GetMapping("udiwms/udiinfo/superSearch") | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse superSearch(FilterUdiInfoRequest filterUdiInfoRequest) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (StrUtil.isEmpty(filterUdiInfoRequest.getNameCode()) && StrUtil.isEmpty(filterUdiInfoRequest.getUdiCode())) { | 
			
		
	
		
			
				
					|  |  |  |  |             return ResultVOUtils.error(500, "DI不能为空!"); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         if (StrUtil.isNotEmpty(filterUdiInfoRequest.getUdiCode())) { | 
			
		
	
		
			
				
					|  |  |  |  |             UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiInfoRequest.getUdiCode()); | 
			
		
	
		
			
				
					|  |  |  |  |             if (udiEntity == null) | 
			
		
	
		
			
				
					|  |  |  |  |                 return ResultVOUtils.error(500, "UDI码格式错误!"); | 
			
		
	
		
			
				
					|  |  |  |  |             filterUdiInfoRequest.setNameCode(udiEntity.getUdi()); | 
			
		
	
		
			
				
					|  |  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest(); | 
			
		
	
		
			
				
					|  |  |  |  |         productInfoFilterRequest.setNameCode(filterUdiInfoRequest.getNameCode()); | 
			
		
	
		
			
				
					|  |  |  |  |         productInfoFilterRequest.setPage(filterUdiInfoRequest.getPage()); | 
			
		
	
		
			
				
					|  |  |  |  |         productInfoFilterRequest.setLimit(filterUdiInfoRequest.getLimit()); | 
			
		
	
		
			
				
					|  |  |  |  |         return spGetHttpClient.getSyncDi(productInfoFilterRequest); | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     @AuthRuleAnnotation("") | 
			
		
	
		
			
				
					|  |  |  |  |     @GetMapping("/udiwms/basic/instrument/maintain/filterProduct") | 
			
		
	
	
		
			
				
					|  |  |  | @ -131,4 +161,22 @@ public class UdiSyncController { | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     //出入库同步下载
 | 
			
		
	
		
			
				
					|  |  |  |  |     @GetMapping("udidl/udiwms/syncUdi") | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse syncUdi(ProductInfoFilterRequest productInfoFilterRequest) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         List<ProductInfoEntity> productInfoEntityList = productInfoService.syncDlUdi(productInfoFilterRequest); | 
			
		
	
		
			
				
					|  |  |  |  |         return ResultVOUtils.success(productInfoEntityList); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     //出入库同步下载
 | 
			
		
	
		
			
				
					|  |  |  |  |     @GetMapping("udidl/udiwms/syncCompany") | 
			
		
	
		
			
				
					|  |  |  |  |     public BaseResponse syncCompany(UdiCompanyRequest udiCompanyRequest) { | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         List<UdiCompanyEntity> udiCompanyEntities = udiCompanyService.syncDlCompany(udiCompanyRequest); | 
			
		
	
		
			
				
					|  |  |  |  |         return ResultVOUtils.success(udiCompanyEntities); | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |  | } |