diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java index 1873341..1798ac9 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/basic/UdiInfoController.java @@ -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> listBaseResponse = asyncDiDlHelper.dlLastVersionByDi(filterUdiInfoRequest.getNameCode()); + if (listBaseResponse.getCode() == 20000) { + List 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, "远程服务器未正确响应!"); } } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java index 6e15c75..088256c 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/controller/inout/StockOrderController.java @@ -545,20 +545,6 @@ public class StockOrderController { String genKey = null; if (postStockPrintRequest != null) { -// InCodeLogEntity inCodeLogEntity = new InCodeLogEntity(); -// inCodeLogEntity.setFromType(IncodeStatus.FROM_THRSYS); -// inCodeLogEntity.setUpdateTime(new Date(System.currentTimeMillis())); -// if (postStockPrintRequest.getGenKey() == null) { -// genKey = CustomUtil.getId(); -// inCodeLogEntity.setGenKey(genKey); -// } else { -// genKey = postStockPrintRequest.getGenKey(); -// inCodeLogEntity.setGenKey(postStockPrintRequest.getGenKey()); -// } -// inCodeLogEntity.setStatus(IncodeStatus.PROCESS); -// inCodeLogEntity.setThirdSysFk(postStockPrintRequest.getThirdSys()); -// inCodeLogService.insertInCodeLog(inCodeLogEntity); - List stockPrintEntities = postStockPrintRequest.getDatas(); if (stockPrintEntities != null && stockPrintEntities.size() > 0) { for (StockPrintEntity stockPrintEntity : stockPrintEntities) { @@ -583,8 +569,6 @@ public class StockOrderController { stockQRCodeTextService.insertStockQRCodeText(stockQRCodeTextEntity); } } -// inCodeLogEntity.setStatus(IncodeStatus.FINISH); -// inCodeLogService.updateInCodeLog(inCodeLogEntity); } return genKey; } diff --git a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java index 4e9c70e..284e35e 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/thread/AsyncDiDlHelper.java @@ -54,7 +54,6 @@ public class AsyncDiDlHelper { }); - List udiCompanyEntities = baseResponse.getData(); return udiCompanyEntities; } catch (Exception e) { @@ -101,4 +100,21 @@ public class AsyncDiDlHelper { return ResultVOUtils.error(500, "连接UDI国家数据库下载出错!"); } } + + public BaseResponse> dlLastVersionByDi(String deviceId) { + Map paramMap = new HashMap<>(16); + paramMap.put("deviceId", deviceId); + String response = HttpClient.mipsGet(udiUrl + "/udidl/device/dlLastVersionByDi", paramMap); + try { + BaseResponse> baseResponse = + JSONObject.parseObject(response, new TypeReference>>() { + }); + return baseResponse; + + } catch (Exception e) { + e.printStackTrace(); + return ResultVOUtils.error(500, "连接UDI国家数据库下载出错!"); + } + } + }