|
|
|
@ -683,8 +683,6 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
IoCodeTempService ioCodeTempService;
|
|
|
|
|
@Resource
|
|
|
|
@ -700,7 +698,7 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
public BaseResponse addAliBizProduct(@RequestBody AddBizProductReqeust addBizProductReqeust) {
|
|
|
|
|
//先获取阿里的行类 进行转换
|
|
|
|
|
AliYljgSearchbill aliData = addBizProductReqeust.getAliData();
|
|
|
|
|
if (aliData == null){
|
|
|
|
|
if (aliData == null) {
|
|
|
|
|
return ResultVOUtils.error("请先选择阿里的单据信息");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -712,37 +710,37 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
aliYljgSearchbillReqeust.setFromRefUserId(fromRefUserId);
|
|
|
|
|
AliYljgBillDetail aliYljgBillDetail = alihealthBusService.aliYljgBillDetail(aliYljgSearchbillReqeust);
|
|
|
|
|
|
|
|
|
|
if (aliYljgBillDetail == null){
|
|
|
|
|
if (aliYljgBillDetail == null) {
|
|
|
|
|
return ResultVOUtils.error("未找到单据信息!");
|
|
|
|
|
}
|
|
|
|
|
List<AliYljgBillDetailDrug> aliYljgBillDetailDrugList = aliYljgBillDetail.getAliYljgBillDetailDrugList();
|
|
|
|
|
if (CollUtil.isEmpty(aliYljgBillDetailDrugList)){
|
|
|
|
|
if (CollUtil.isEmpty(aliYljgBillDetailDrugList)) {
|
|
|
|
|
return ResultVOUtils.error("单据明细为空!");
|
|
|
|
|
}
|
|
|
|
|
List<AliYljgBillDetailDrugCode> aliYljgBillDetailDrugCodeList = aliYljgBillDetailDrugList.get(0).getAliYljgBillDetailDrugCodeList();
|
|
|
|
|
if (CollUtil.isEmpty(aliYljgBillDetailDrugCodeList)){
|
|
|
|
|
if (CollUtil.isEmpty(aliYljgBillDetailDrugCodeList)) {
|
|
|
|
|
return ResultVOUtils.error("单据码明细为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String code = aliYljgBillDetailDrugCodeList.get(0).getCode();
|
|
|
|
|
if (StrUtil.isEmpty(code)){
|
|
|
|
|
if (StrUtil.isEmpty(code)) {
|
|
|
|
|
return ResultVOUtils.error("单据码为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UdiEntity drugInfo = FilterUdiUtils.getDrugInfo(code);
|
|
|
|
|
if (drugInfo == null){
|
|
|
|
|
if (drugInfo == null) {
|
|
|
|
|
return ResultVOUtils.error("单据码解析药品信息错误!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取药品信息
|
|
|
|
|
String nameCode = drugInfo.getUdi();
|
|
|
|
|
if (StrUtil.isEmpty(nameCode)){
|
|
|
|
|
if (StrUtil.isEmpty(nameCode)) {
|
|
|
|
|
return ResultVOUtils.error("单据码解析药品标识错误!");
|
|
|
|
|
}
|
|
|
|
|
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
|
|
|
|
|
filterUdiRelRequest.setNameCode(nameCode);
|
|
|
|
|
List<UdiRelevanceResponse> udiRelevanceResponses = udiRelevanceDao.filterUdiRelevance(filterUdiRelRequest);
|
|
|
|
|
if (CollUtil.isEmpty(udiRelevanceResponses)){
|
|
|
|
|
if (CollUtil.isEmpty(udiRelevanceResponses)) {
|
|
|
|
|
return ResultVOUtils.error("未通过药品标识获取详情信息!");
|
|
|
|
|
}
|
|
|
|
|
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceResponses.get(0);
|
|
|
|
@ -762,21 +760,26 @@ public class IoOrderDetailBizController extends BaseController {
|
|
|
|
|
addBizProductReqeust.setExpireDate(aliYljgBillDetailDrug.getProduceDate());
|
|
|
|
|
addBizProductReqeust.setOrderEntity(ioOrderEntity);
|
|
|
|
|
BaseResponse response = orderDetailBizService.addBizProduct(addBizProductReqeust);
|
|
|
|
|
if (response.getCode() != 20000){
|
|
|
|
|
if (response.getCode() != 20000) {
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
if (i == 0){
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
ioOrderEntity = JSONObject.parseObject(JSONObject.toJSONString(response.getData()), IoOrderEntity.class);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AddOrderRequest addOrderRequest = new AddOrderRequest();
|
|
|
|
|
BeanUtils.copyProperties(ioOrderEntity,addOrderRequest);
|
|
|
|
|
AddOrderRequest addOrderRequest = new AddOrderRequest();
|
|
|
|
|
BeanUtils.copyProperties(ioOrderEntity, addOrderRequest);
|
|
|
|
|
for (int i = 0; i < aliYljgBillDetailDrugCodeList.size(); i++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// IoCodeLostEntity ioCodeLostEntity = new IoCodeLostEntity();
|
|
|
|
|
// ioCodeLostEntity.set
|
|
|
|
|
// todo 补三期进扫码补齐表
|
|
|
|
|
AliYljgBillDetailDrugCode aliYljgBillDetailDrugCode = aliYljgBillDetailDrugCodeList.get(i);
|
|
|
|
|
addOrderRequest.setCode(aliYljgBillDetailDrugCode.getCode());
|
|
|
|
|
BaseResponse response = ioCodeTempService.addDrugOrderWeb(addOrderRequest);
|
|
|
|
|
if (response.getCode() != 20000){
|
|
|
|
|
if (response.getCode() != 20000) {
|
|
|
|
|
return response;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|