|
|
|
@ -250,6 +250,7 @@ public class IoCodeTempService {
|
|
|
|
|
AlihealthYljgUtils alihealthYljgUtils;
|
|
|
|
|
@Resource
|
|
|
|
|
AuthCompanyMapper authCompanyMapper;
|
|
|
|
|
|
|
|
|
|
public BaseResponse addDrugOrderWeb(AddOrderRequest addOrderRequest) {
|
|
|
|
|
AddCodeResult addCodeResult = new AddCodeResult();
|
|
|
|
|
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(addOrderRequest.getAction());
|
|
|
|
@ -284,37 +285,37 @@ public class IoCodeTempService {
|
|
|
|
|
udiEntity.setProduceDate(codeLostEntity.getProduceDate());
|
|
|
|
|
udiEntity.setExpireDate(codeLostEntity.getExpireDate());
|
|
|
|
|
} else {
|
|
|
|
|
if (relCodeDetailResponse != null) {
|
|
|
|
|
udiEntity.setBatchNo(relCodeDetailResponse.getBatchNo());
|
|
|
|
|
udiEntity.setProduceDate(DateUtil.formatDate(relCodeDetailResponse.getMadeDate(), "yyMMdd"));
|
|
|
|
|
udiEntity.setExpireDate(DateUtil.formatDate(relCodeDetailResponse.getValidateDate(), "yyMMdd"));
|
|
|
|
|
} else {
|
|
|
|
|
// 还是为空就调用查码明细的结构
|
|
|
|
|
AuthCompany authCompany = authCompanyMapper.selectOne(
|
|
|
|
|
new QueryWrapper<AuthCompany>().last("limit 1")
|
|
|
|
|
);
|
|
|
|
|
if (authCompany != null) {
|
|
|
|
|
AlihealthYljgCodedetailReqeust alihealthYljgCodedetailReqeust = new AlihealthYljgCodedetailReqeust();
|
|
|
|
|
alihealthYljgCodedetailReqeust.setCodes(code);
|
|
|
|
|
BaseResponse<List<IoCodeLostEntity>> response = alihealthYljgUtils.codedetail(alihealthYljgCodedetailReqeust);
|
|
|
|
|
if (response.getCode() == 20000) {
|
|
|
|
|
List<IoCodeLostEntity> ioCodeLostEntityList = response.getData();
|
|
|
|
|
if (ioCodeLostEntityList != null && ioCodeLostEntityList.size() > 0) {
|
|
|
|
|
IoCodeLostEntity ioCodeLostEntity = ioCodeLostEntityList.get(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
codeLostService.saveOrUpdate(ioCodeLostEntity);
|
|
|
|
|
udiEntity.setBatchNo(ioCodeLostEntity.getBatchNo());
|
|
|
|
|
udiEntity.setProduceDate(ioCodeLostEntity.getProduceDate());
|
|
|
|
|
udiEntity.setExpireDate(ioCodeLostEntity.getExpireDate());
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
log.error("拉取阿里码明细访问失败===" + response.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// if (relCodeDetailResponse != null) {
|
|
|
|
|
// udiEntity.setBatchNo(relCodeDetailResponse.getBatchNo());
|
|
|
|
|
// udiEntity.setProduceDate(DateUtil.formatDate(relCodeDetailResponse.getMadeDate(), "yyMMdd"));
|
|
|
|
|
// udiEntity.setExpireDate(DateUtil.formatDate(relCodeDetailResponse.getValidateDate(), "yyMMdd"));
|
|
|
|
|
// } else {
|
|
|
|
|
// // 还是为空就调用查码明细的结构
|
|
|
|
|
// AuthCompany authCompany = authCompanyMapper.selectOne(
|
|
|
|
|
// new QueryWrapper<AuthCompany>().last("limit 1")
|
|
|
|
|
// );
|
|
|
|
|
// if (authCompany != null) {
|
|
|
|
|
// AlihealthYljgCodedetailReqeust alihealthYljgCodedetailReqeust = new AlihealthYljgCodedetailReqeust();
|
|
|
|
|
// alihealthYljgCodedetailReqeust.setCodes(code);
|
|
|
|
|
// BaseResponse<List<IoCodeLostEntity>> response = alihealthYljgUtils.codedetail(alihealthYljgCodedetailReqeust);
|
|
|
|
|
// if (response.getCode() == 20000) {
|
|
|
|
|
// List<IoCodeLostEntity> ioCodeLostEntityList = response.getData();
|
|
|
|
|
// if (ioCodeLostEntityList != null && ioCodeLostEntityList.size() > 0) {
|
|
|
|
|
// IoCodeLostEntity ioCodeLostEntity = ioCodeLostEntityList.get(0);
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// codeLostService.saveOrUpdate(ioCodeLostEntity);
|
|
|
|
|
// udiEntity.setBatchNo(ioCodeLostEntity.getBatchNo());
|
|
|
|
|
// udiEntity.setProduceDate(ioCodeLostEntity.getProduceDate());
|
|
|
|
|
// udiEntity.setExpireDate(ioCodeLostEntity.getExpireDate());
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// log.error("拉取阿里码明细访问失败===" + response.getMessage());
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -349,7 +350,7 @@ public class IoCodeTempService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectByNameCode(udiEntity.getUdi());
|
|
|
|
|
if (udiRelevanceResponse == null){
|
|
|
|
|
if (udiRelevanceResponse == null) {
|
|
|
|
|
return ResultVOUtils.error(604, "当前产品未维护!");
|
|
|
|
|
}
|
|
|
|
|
long recent = 0;
|
|
|
|
@ -636,7 +637,13 @@ public class IoCodeTempService {
|
|
|
|
|
codeEnttity.setInBatchNo(inBatch);
|
|
|
|
|
//是否边扫边校验
|
|
|
|
|
if (addOrderRequest.getOrderType() == ConstantStatus.ORDER_TYPE_NORMAL && bussinessTypeEntity.isCheckEnable()) {
|
|
|
|
|
String errMsg = ioCheckInoutService.checkCode(codeEnttity);
|
|
|
|
|
String errMsg = "";
|
|
|
|
|
if (bussinessTypeEntity.getCheckWebNew() == 2) {
|
|
|
|
|
errMsg = ioCheckInoutService.checkDrugNoPiCode(codeEnttity);
|
|
|
|
|
} else {
|
|
|
|
|
errMsg = ioCheckInoutService.checkCode(codeEnttity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (errMsg != null) {
|
|
|
|
|
return ResultVOUtils.error(500, errMsg);
|
|
|
|
|
} else
|
|
|
|
|