云霄妇幼相关修改

scpwxyy
yewj 7 months ago
parent 98cbe3d0fa
commit 2be1fdbf83

@ -1374,6 +1374,12 @@ public class CtqyyClient extends CommonHttpClient {
public BaseResponse getPrescribes(UdiwmsBasicSkPrescribeRequest udiwmsBasicSkPrescribeRequest) {
if (IntUtil.value(udiwmsBasicSkPrescribeRequest.getInOutType()) == 0) {
LambdaQueryWrapper<VInsurNationGoodsPhysic> wrapper = new LambdaQueryWrapper<>();
String startTime = udiwmsBasicSkPrescribeRequest.getStartTime();
String endTime = udiwmsBasicSkPrescribeRequest.getEndTime();
wrapper.ge(StrUtil.isNotEmpty(startTime), VInsurNationGoodsPhysic::getSEL_RETN_TIME, startTime + " 00:00:00");
wrapper.le(StrUtil.isNotEmpty(endTime), VInsurNationGoodsPhysic::getSEL_RETN_TIME, endTime + " 23:59:59");
String code = udiwmsBasicSkPrescribeRequest.getCode();
wrapper.and(StrUtil.isNotEmpty(code), t -> t.eq(VInsurNationGoodsPhysic::getSTOOUT_NO, code).or().eq(VInsurNationGoodsPhysic::getRXNO, code));
IPage<VInsurNationGoodsPhysic> page = goodsPhysicMapper
@ -1402,7 +1408,12 @@ public class CtqyyClient extends CommonHttpClient {
PageSimpleResponse<IoCollectOrder> pageSimpleResponse = new PageSimpleResponse<>();
if (udiwmsThrOrderRequest.getBusType().equals(BusTypeConstant.CGJH001.getBusType())) {
LambdaQueryWrapper<VYpzsPlanInfo> wrapper = new LambdaQueryWrapper<>();
//补充其他查询条件
// String startTime = udiwmsThrOrderRequest.getStartTime();
// String endTime = udiwmsThrOrderRequest.getEndTime();
// wrapper.ge(StrUtil.isNotEmpty(startTime),VYpzsPlanInfo::getKEEP_BOOK_TIME,startTime+" 00:00:00");
// wrapper.le(StrUtil.isNotEmpty(endTime),VYpzsPlanInfo::getKEEP_BOOK_TIME,endTime+" 23:59:59");
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsPlanInfo::getCGDBH, udiwmsThrOrderRequest.getBillNo());
IPage<VYpzsPlanInfo> page = vYpzsPlanInfoMapper.selectPage(new Page<VYpzsPlanInfo>(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), wrapper);
List<VYpzsPlanInfo> planInfos = page.getRecords();
@ -1454,7 +1465,12 @@ public class CtqyyClient extends CommonHttpClient {
pageSimpleResponse.setList(ioCollectOrders);
} else {
LambdaQueryWrapper<VYpzsIoInfo> wrapper = new LambdaQueryWrapper<>();
//补充其他查询条件
String startTime = udiwmsThrOrderRequest.getStartTime();
String endTime = udiwmsThrOrderRequest.getEndTime();
wrapper.ge(StrUtil.isNotEmpty(startTime), VYpzsIoInfo::getKEEP_BOOK_TIME, startTime + " 00:00:00");
wrapper.le(StrUtil.isNotEmpty(endTime), VYpzsIoInfo::getKEEP_BOOK_TIME, endTime + " 23:59:59");
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBillNo()), VYpzsIoInfo::getPHYSIC_CODE, udiwmsThrOrderRequest.getBillNo());
wrapper.eq(StrUtil.isNotBlank(udiwmsThrOrderRequest.getBusType()), VYpzsIoInfo::getIO_SORT, udiwmsThrOrderRequest.getBusType());
Page<VYpzsIoInfo> page = vYpzsIoInfoMapper.selectPage(new Page<VYpzsIoInfo>(udiwmsThrOrderRequest.getPage(), udiwmsThrOrderRequest.getLimit()), wrapper);

@ -202,38 +202,78 @@ public class YxfyyyClient extends CommonHttpClient {
}
/**
*
*
*
* @param udiwmsProductRequest
* @return
*/
@Override
public BaseResponse getProducts(UdiwmsProductRequest udiwmsProductRequest) {
CtqyyRequest ctqyyRequest = new CtqyyRequest();
ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialDict"));
ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsProductRequest));
String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_PI_QUERY_URL), ctqyyRequest);
response = parserResult(response);
try {
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
Map map = (Map) baseResponse.getData();
List<ZzzyyProductsResponse> zzzyyProductsResponse = JSON.parseArray(map.get("list") + "", ZzzyyProductsResponse.class);
for (ZzzyyProductsResponse productsResponse : zzzyyProductsResponse) {
//判断要是规格和型号一致就是取规格 不一致就合并
if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isNotEmpty(productsResponse.getStandard())) {
if (productsResponse.getModel_number().equals(productsResponse.getStandard())) {
productsResponse.setStandard(productsResponse.getStandard());
} else {
productsResponse.setStandard(productsResponse.getStandard() + productsResponse.getModel_number());
if (udiwmsProductRequest.getProductType().equals(Constants.PRODUCT_TYPE_DEVICE)) {
CtqyyRequest ctqyyRequest = new CtqyyRequest();
ctqyyRequest.setMsgHeader(getMsgHeader("getMaterialDict"));
ctqyyRequest.setMsgBody(JSONUtil.toJsonStr(udiwmsProductRequest));
String response = httpClient.postJson(thrSystemDetailService.getUrlExclude(Constants.URL_NAME_PI_QUERY_URL), ctqyyRequest);
response = parserResult(response);
try {
BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
Map map = (Map) baseResponse.getData();
List<ZzzyyProductsResponse> zzzyyProductsResponse = JSON.parseArray(map.get("list") + "", ZzzyyProductsResponse.class);
for (ZzzyyProductsResponse productsResponse : zzzyyProductsResponse) {
//判断要是规格和型号一致就是取规格 不一致就合并
if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isNotEmpty(productsResponse.getStandard())) {
if (productsResponse.getModel_number().equals(productsResponse.getStandard())) {
productsResponse.setStandard(productsResponse.getStandard());
} else {
productsResponse.setStandard(productsResponse.getStandard() + productsResponse.getModel_number());
}
} else if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isBlank(productsResponse.getStandard())) {
productsResponse.setStandard(productsResponse.getModel_number());
}
} else if (StrUtil.isNotEmpty(productsResponse.getModel_number()) && StrUtil.isBlank(productsResponse.getStandard())) {
productsResponse.setStandard(productsResponse.getModel_number());
productsResponse.setProductType(1);
}
map.put("list", JSON.toJSON(zzzyyProductsResponse));
baseResponse.setData("");
baseResponse.setData(map);
return baseResponse;
} catch (Exception e) {
log.error("解析长泰区医院智业接口返回产品信息字典数据异常,返回结果:{}", response);
log.error("异常信息:{}", e);
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
}
map.put("list", JSON.toJSON(zzzyyProductsResponse));
baseResponse.setData("");
baseResponse.setData(map);
return baseResponse;
} catch (Exception e) {
log.error("解析云霄妇幼医院智业接口返回产品信息字典数据异常,返回结果:{}", response);
log.error("异常信息:{}", e);
return ResultVOUtils.error(500, "网络错误,或远程服务器异常无法返回正确结果(" + response + ")");
} else if (udiwmsProductRequest.getProductType().equals(Constants.PRODUCT_TYPE_DRUG)) {
LambdaQueryWrapper<VYpzsPhysicDict> wrapper = new LambdaQueryWrapper();
//补充其他查询条件
wrapper.eq(StrUtil.isNotBlank(udiwmsProductRequest.getCode()), VYpzsPhysicDict::getPHYSIC_CODE, udiwmsProductRequest.getCode());
wrapper.eq(StrUtil.isNotBlank(udiwmsProductRequest.getName()), VYpzsPhysicDict::getPHYSIC_NAME, udiwmsProductRequest.getName());
wrapper.eq(StrUtil.isNotBlank(udiwmsProductRequest.getRegisterNo()), VYpzsPhysicDict::getPHYSIC_NO, udiwmsProductRequest.getRegisterNo());
IPage<VYpzsPhysicDict> page = vYpzsPhysicDictMapper.selectPage(new Page<VYpzsPhysicDict>(udiwmsProductRequest.getPage(), udiwmsProductRequest.getLimit()), wrapper);
List<VYpzsPhysicDict> physicDictEntities = page.getRecords();
List<ThrProductsEntity> thrProductsEntityList = null;
if (CollUtil.isNotEmpty(physicDictEntities)) {
//数据处理以thr_products 返回
thrProductsEntityList = physicDictEntities.stream().map(dict -> {
ThrProductsEntity products = new ThrProductsEntity();
products.setCode(dict.getPHYSIC_CODE());
products.setName(dict.getPHYSIC_NAME());
products.setMeasname(dict.getPACK_UNIT());
products.setSpec(dict.getPACK_SPEC());
products.setYbbm(dict.getCOUNTRY_CODE());
products.setPrepnSpec(dict.getPHYSIC_SPEC());
products.setPrepnUnit(dict.getPHYSIC_UNIT());
products.setProductType(2);
return products;
}).collect(Collectors.toList());
}
PageSimpleResponse<ThrProductsEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(page.getTotal());
pageSimpleResponse.setList(thrProductsEntityList);
return ResultVOUtils.success(pageSimpleResponse);
}
log.error("解析长泰区医院医疗类型,返回结果:{}", udiwmsProductRequest.getProductType());
return ResultVOUtils.error(500, "医疗类型不正确productType" + udiwmsProductRequest.getProductType());
}
@Override

Loading…
Cancel
Save