国家库DI更新下载最新版本

fencang
anthonyywj2 3 years ago
parent 7250c03a4c
commit 43f5f954e7

@ -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, "远程服务器未正确响应");
}
}

@ -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<StockPrintEntity> 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;
}

@ -54,7 +54,6 @@ public class AsyncDiDlHelper {
});
List<UdiCompanyEntity> udiCompanyEntities = baseResponse.getData();
return udiCompanyEntities;
} catch (Exception e) {
@ -101,4 +100,21 @@ public class AsyncDiDlHelper {
return ResultVOUtils.error(500, "连接UDI国家数据库下载出错");
}
}
public BaseResponse<List<ProductInfoEntity>> dlLastVersionByDi(String deviceId) {
Map<String, Object> paramMap = new HashMap<>(16);
paramMap.put("deviceId", deviceId);
String response = HttpClient.mipsGet(udiUrl + "/udidl/device/dlLastVersionByDi", paramMap);
try {
BaseResponse<List<ProductInfoEntity>> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<List<ProductInfoEntity>>>() {
});
return baseResponse;
} catch (Exception e) {
e.printStackTrace();
return ResultVOUtils.error(500, "连接UDI国家数据库下载出错");
}
}
}

Loading…
Cancel
Save