|
|
|
@ -33,6 +33,7 @@ import com.glxp.sale.admin.util.HttpClient;
|
|
|
|
|
import com.glxp.sale.common.enums.ResultEnum;
|
|
|
|
|
import com.glxp.sale.common.res.BaseResponse;
|
|
|
|
|
import com.glxp.sale.common.util.ResultVOUtils;
|
|
|
|
|
import org.apache.regexp.RE;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -191,6 +192,37 @@ public class UdiInfoController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("udiwms/udiinfo/dlLastVersionByDi")
|
|
|
|
|
public BaseResponse dlLastVersionByDi(FilterUdiInfoRequest filterUdiInfoRequest) {
|
|
|
|
|
|
|
|
|
|
if (StrUtil.isEmpty(filterUdiInfoRequest.getNameCode())) {
|
|
|
|
|
return ResultVOUtils.error(500, "DI不能为空!");
|
|
|
|
|
}
|
|
|
|
|
ProductInfoFilterRequest productInfoFilterRequest = new ProductInfoFilterRequest();
|
|
|
|
|
productInfoFilterRequest.setUuid(filterUdiInfoRequest.getNameCode());
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
BaseResponse<List<ProductInfoEntity>> listBaseResponse = asyncDiDlHelper.dlLastVersionByDi(filterUdiInfoRequest.getNameCode());
|
|
|
|
|
if (listBaseResponse.getCode() == 20000) {
|
|
|
|
|
List<ProductInfoEntity> productInfoEntityList = listBaseResponse.getData();
|
|
|
|
|
if (CollUtil.isNotEmpty(productInfoEntityList)) {
|
|
|
|
|
productInfoService.insertProductInfos(productInfoEntityList);
|
|
|
|
|
return ResultVOUtils.success("下载成功!");
|
|
|
|
|
} else {
|
|
|
|
|
ResultVOUtils.error(500, "未查询到该产品DI");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return listBaseResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return ResultVOUtils.error(500, "连接UDI数据下载服务出错!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取同步库医疗器械注册人信息
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@ -202,12 +234,10 @@ public class UdiInfoController {
|
|
|
|
|
if (udiDlDeviceResponse.getCode() != 20000) {
|
|
|
|
|
return udiDlDeviceResponse;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return udiDlDeviceResponse;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
return ResultVOUtils.error(500, "连接UDI数据下载服务出错!");
|
|
|
|
|
return ResultVOUtils.error(500, "远程服务器未正确响应!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|