|
|
|
@ -99,7 +99,8 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
|
|
|
|
|
private final String[] buyType_3506 = {};
|
|
|
|
|
|
|
|
|
|
private final String[] buyType_35051 = {"SC72249388338364","SC72197936495755"};
|
|
|
|
|
private final String[] buyType_35051 = {"SC72197936495755"};
|
|
|
|
|
|
|
|
|
|
@Value("${DSF_XML_SQL_TYPE:MySql}")
|
|
|
|
|
private String defXmlSqlType;
|
|
|
|
|
@Resource
|
|
|
|
@ -1711,7 +1712,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
} else if (matchBusType(busType, buyType_3506)) {
|
|
|
|
|
optionUploadCollectOrder3506(ioCollectOrder);
|
|
|
|
|
} else if (matchBusType(busType, buyType_35051)) {
|
|
|
|
|
optionUploadCollectOrder35051(ioCollectOrder);
|
|
|
|
|
return optionUploadCollectOrder35051(ioCollectOrder);
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "上传类型都未对上请检查单据类型");
|
|
|
|
|
}
|
|
|
|
@ -2037,90 +2038,142 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public BaseResponse optionUploadCollectOrder35051(IoCollectOrder ioCollectOrder) {
|
|
|
|
|
List<CollectOrderBizResponse> bizList = ioCollectOrder.getCollectOrderBizResponseList();
|
|
|
|
|
|
|
|
|
|
String stoout_no = StringUtils.isBlank(ioCollectOrder.getBackupOrderRemark1()) ? ioCollectOrder.getBackupOrderRemark2() : ioCollectOrder.getBackupOrderRemark1();
|
|
|
|
|
List<VInsurNationGoodsPhysic> vInsurNationGoodsPhysics = goodsPhysicMapper.selectList(new LambdaQueryWrapper<VInsurNationGoodsPhysic>().eq(VInsurNationGoodsPhysic::getSTOOUT_NO, stoout_no));
|
|
|
|
|
if (CollUtil.isNotEmpty(vInsurNationGoodsPhysics)) {
|
|
|
|
|
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
|
|
|
|
|
if (CollUtil.isNotEmpty(bizList)) {
|
|
|
|
|
List<Xsck35051Request> xsck35051Requests = new ArrayList<>();
|
|
|
|
|
for (CollectOrderBizResponse collectOrderBizResponse : collectOrderBizResponseList) {
|
|
|
|
|
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(collectOrderBizResponse.getRelId());
|
|
|
|
|
for (CollectOrderBizResponse item : bizList) {
|
|
|
|
|
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(item.getRelId());
|
|
|
|
|
String itemCode = basicUdirelEntity.getMainId();
|
|
|
|
|
for (VInsurNationGoodsPhysic vInsurNationGoodsPhysic : vInsurNationGoodsPhysics) {
|
|
|
|
|
if (vInsurNationGoodsPhysic.getFIXMEDINS_HILIST_ID().equals(itemCode)) {
|
|
|
|
|
String[] codes = collectOrderBizResponse.getFinishUdiCode().split(",");
|
|
|
|
|
// for (CollectOrderBizResponse item : collectOrderBizResponseList) {
|
|
|
|
|
// if (item.getYbbm().equals(itemCode)) {
|
|
|
|
|
String[] codes = item.getFinishUdiCode().split(",");
|
|
|
|
|
|
|
|
|
|
String nameCode = item.getNameCode();
|
|
|
|
|
BasicProductsEntity basicProductsEntity = basicProductsDao.selectOne(
|
|
|
|
|
new QueryWrapper<BasicProductsEntity>().eq("nameCode", nameCode).last("limit 1")
|
|
|
|
|
);
|
|
|
|
|
if (Objects.isNull(basicProductsEntity)) {
|
|
|
|
|
return ResultVOUtils.error(500, "产品为空请检查");
|
|
|
|
|
}
|
|
|
|
|
Integer packLevel = Integer.valueOf(basicProductsEntity.getPackLevel());
|
|
|
|
|
List<DrugInfoRequest> drugTraceList = new ArrayList<>();
|
|
|
|
|
List<String> codeList = new ArrayList<>();
|
|
|
|
|
// 遍历fruits数组
|
|
|
|
|
for (String code : codes) {
|
|
|
|
|
if (StrUtil.isNotBlank(code)) {
|
|
|
|
|
List<RelCodeDetail> relCodeDetailList = relCodeDetailService.getAllNext(code);
|
|
|
|
|
if (relCodeDetailList != null && relCodeDetailList.size() > 0) {
|
|
|
|
|
for (RelCodeDetail relCodeDetail : relCodeDetailList) {
|
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
|
request.setDrug_trac_codg(relCodeDetail.getCurCode());
|
|
|
|
|
drugTraceList.add(request);
|
|
|
|
|
}
|
|
|
|
|
codeList.add(relCodeDetail.getCurCode());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 级别为2的产品码不可能只有一个
|
|
|
|
|
if (packLevel > 1 && codeList.size() < 2) {
|
|
|
|
|
return ResultVOUtils.error(500, "大包装码关联关系拉取不到请检查" + code);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Set<String> set = new HashSet(codeList);
|
|
|
|
|
for (String code : set) {
|
|
|
|
|
DrugInfoRequest request = new DrugInfoRequest();
|
|
|
|
|
request.setDrug_trac_codg(code);
|
|
|
|
|
drugTraceList.add(request);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CollUtil.isEmpty(drugTraceList)) {
|
|
|
|
|
return ResultVOUtils.error(500, "单据要传的码为空请检查");
|
|
|
|
|
}
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
String formattedDate = sdf.format(ioCollectOrder.getBillTime());
|
|
|
|
|
//todo 处方药标志先写死 后面要商量怎么获得
|
|
|
|
|
String rxFlag ="1";
|
|
|
|
|
log.error("optionUploadCollectOrder35051===item==="+item);
|
|
|
|
|
Xsck35051Request xsck35051Request = Xsck35051Request.builder()
|
|
|
|
|
.med_list_codg(vInsurNationGoodsPhysic.getMED_LIST_CODG())
|
|
|
|
|
.fixmedins_hilist_id(vInsurNationGoodsPhysic.getFIXMEDINS_HILIST_ID())
|
|
|
|
|
.fixmedins_hilist_name(vInsurNationGoodsPhysic.getFIXMEDINS_HILIST_NAME())
|
|
|
|
|
.fixmedins_bchno(vInsurNationGoodsPhysic.getFIXMEDINS_BCHNO())
|
|
|
|
|
.prsc_dr_cert_type(vInsurNationGoodsPhysic.getPRSC_DR_CERT_TYPE())
|
|
|
|
|
.prsc_dr_certno(vInsurNationGoodsPhysic.getPRSC_DR_CERTNO())
|
|
|
|
|
.prsc_dr_name(vInsurNationGoodsPhysic.getPRSC_DR_NAME())
|
|
|
|
|
.phar_cert_type(vInsurNationGoodsPhysic.getPHAR_CERT_TYPE())
|
|
|
|
|
.phar_certno(vInsurNationGoodsPhysic.getPHAR_CERTNO())
|
|
|
|
|
.phar_name(vInsurNationGoodsPhysic.getPHAR_NAME())
|
|
|
|
|
.phar_prac_cert_no(vInsurNationGoodsPhysic.getPHAR_PRAC_CERT_NO())
|
|
|
|
|
.hi_feesetl_type(vInsurNationGoodsPhysic.getHI_FEESETL_TYPE())
|
|
|
|
|
.setl_id(vInsurNationGoodsPhysic.getSETL_ID())
|
|
|
|
|
.mdtrt_sn(vInsurNationGoodsPhysic.getMDTRT_SN())
|
|
|
|
|
.psn_no(vInsurNationGoodsPhysic.getPSN_NO())
|
|
|
|
|
.psn_cert_type(vInsurNationGoodsPhysic.getPSN_CERT_TYPE())
|
|
|
|
|
.certno(vInsurNationGoodsPhysic.getCERTNO())
|
|
|
|
|
.psn_name(vInsurNationGoodsPhysic.getPSN_NAME())
|
|
|
|
|
.manu_lotnum(vInsurNationGoodsPhysic.getMANU_LOTNUM())
|
|
|
|
|
.manu_date(vInsurNationGoodsPhysic.getMANU_DATE())
|
|
|
|
|
.expy_end(vInsurNationGoodsPhysic.getEXPY_END())
|
|
|
|
|
.rx_flag(vInsurNationGoodsPhysic.getRX_FLAG())
|
|
|
|
|
.trdn_flag(vInsurNationGoodsPhysic.getTRDN_FLAG())
|
|
|
|
|
.finl_trns_pric(vInsurNationGoodsPhysic.getFINL_TRNS_PRIC())
|
|
|
|
|
.rxno(vInsurNationGoodsPhysic.getRXNO())
|
|
|
|
|
.rx_circ_flag(vInsurNationGoodsPhysic.getRX_CIRC_FLAG())
|
|
|
|
|
.rtal_docno(vInsurNationGoodsPhysic.getRTAL_DOCNO())
|
|
|
|
|
.stoout_no(vInsurNationGoodsPhysic.getSTOOUT_NO())
|
|
|
|
|
.bchno(vInsurNationGoodsPhysic.getBCHNO())
|
|
|
|
|
.drug_prod_barc(vInsurNationGoodsPhysic.getRUG_PROD_BARC())
|
|
|
|
|
.shelf_posi(vInsurNationGoodsPhysic.getSHELF_POSI())
|
|
|
|
|
.sel_retn_cnt(vInsurNationGoodsPhysic.getSEL_RETN_CNT())
|
|
|
|
|
.sel_retn_time(vInsurNationGoodsPhysic.getSEL_RETN_TIME())
|
|
|
|
|
.sel_retn_opter_name(vInsurNationGoodsPhysic.getSEL_RETN_OPTER_NAME())
|
|
|
|
|
.memo(vInsurNationGoodsPhysic.getMEMO())
|
|
|
|
|
.mdtrt_setl_type(vInsurNationGoodsPhysic.getMDTRT_SETL_TYPE())
|
|
|
|
|
.med_list_codg(item.getYbbm())
|
|
|
|
|
.fixmedins_hilist_id(item.getNameCode())
|
|
|
|
|
.fixmedins_hilist_name(item.getCpmctymc())
|
|
|
|
|
.fixmedins_bchno(item.getOrderIdFk())
|
|
|
|
|
.prsc_dr_cert_type(null)
|
|
|
|
|
.prsc_dr_certno(null)
|
|
|
|
|
.prsc_dr_name(null)
|
|
|
|
|
.phar_cert_type(null)
|
|
|
|
|
.phar_certno(null)
|
|
|
|
|
.phar_name(null)
|
|
|
|
|
.phar_prac_cert_no(null)
|
|
|
|
|
.hi_feesetl_type(null)
|
|
|
|
|
.setl_id(null)
|
|
|
|
|
.mdtrt_sn(null)
|
|
|
|
|
.psn_no(null)
|
|
|
|
|
.psn_cert_type(null)
|
|
|
|
|
.certno(null)
|
|
|
|
|
.psn_name(null)
|
|
|
|
|
.manu_lotnum(item.getBatchNo())
|
|
|
|
|
.manu_date(DateUtil.timeTransition(item.getProductDate()))
|
|
|
|
|
.expy_end(DateUtil.timeTransition(item.getExpireDate()))
|
|
|
|
|
.rx_flag(rxFlag)
|
|
|
|
|
.trdn_flag(item.getTrdnFlag())
|
|
|
|
|
.finl_trns_pric(null)
|
|
|
|
|
.rxno(null)
|
|
|
|
|
.rx_circ_flag(null)
|
|
|
|
|
.rtal_docno(null)
|
|
|
|
|
.stoout_no(null)
|
|
|
|
|
.bchno(null)
|
|
|
|
|
.drug_prod_barc(null)
|
|
|
|
|
.shelf_posi(null)
|
|
|
|
|
.sel_retn_cnt(item.getCount())
|
|
|
|
|
.sel_retn_time(formattedDate)
|
|
|
|
|
.sel_retn_opter_name(ioCollectOrder.getCreateUser())
|
|
|
|
|
.memo(null)
|
|
|
|
|
.mdtrt_setl_type(null)
|
|
|
|
|
.drugtracinfo(drugTraceList).build();
|
|
|
|
|
xsck35051Requests.add(xsck35051Request);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
BaseXsck35051Request baseXsck35051Request = new BaseXsck35051Request();
|
|
|
|
|
baseXsck35051Request.setSelinfoDetail(xsck35051Requests);
|
|
|
|
|
String jsonStr = JSONUtil.toJsonStr(baseXsck35051Request);
|
|
|
|
|
JSONObject dataJson = JSONObject.parseObject(jsonStr);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ybClient.ybPost("35051", dataJson);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "医保视图数据查不到,请核实");
|
|
|
|
|
return ResultVOUtils.error(500, "上传医保数据为空请核实");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse orderMedicalDelete(PostOrderMedicalDeleteRequest postOrderMedicalDeleteRequest) {
|
|
|
|
|
List<Xsck3507Request> xsck35057Requests = new ArrayList<>();
|
|
|
|
|
String invDataType=null;
|
|
|
|
|
if (matchBusType(postOrderMedicalDeleteRequest.getBusType(), buyType_3501)) {
|
|
|
|
|
invDataType="1";
|
|
|
|
|
} else if (matchBusType(postOrderMedicalDeleteRequest.getBusType(), buyType_3502)) {
|
|
|
|
|
invDataType="2";
|
|
|
|
|
|
|
|
|
|
} else if (matchBusType(postOrderMedicalDeleteRequest.getBusType(), buyType_3505)) {
|
|
|
|
|
invDataType="4";
|
|
|
|
|
|
|
|
|
|
} else if (matchBusType(postOrderMedicalDeleteRequest.getBusType(), buyType_3506)) {
|
|
|
|
|
invDataType="4";
|
|
|
|
|
|
|
|
|
|
} else if (matchBusType(postOrderMedicalDeleteRequest.getBusType(), buyType_35051)) {
|
|
|
|
|
invDataType="4";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Xsck3507Request xsck3507Request = Xsck3507Request.builder()
|
|
|
|
|
.med_list_codg(postOrderMedicalDeleteRequest.getBillNo())
|
|
|
|
|
.inv_data_type(invDataType).build();
|
|
|
|
|
xsck35057Requests.add(xsck3507Request);
|
|
|
|
|
BaseXsck3507Request baseXsck3507Request = new BaseXsck3507Request();
|
|
|
|
|
baseXsck3507Request.setGoodDetail(xsck35057Requests);
|
|
|
|
|
String jsonStr = JSONUtil.toJsonStr(baseXsck3507Request);
|
|
|
|
|
JSONObject dataJson = JSONObject.parseObject(jsonStr);
|
|
|
|
|
return ybClient.ybPost("3507A", dataJson);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void optionUploadCollectOrder3501(IoCollectOrder ioCollectOrder) {
|
|
|
|
|
List<IoCollectOrderBiz> bizList = ioCollectOrder.getBizList();
|
|
|
|
|
if (CollUtil.isNotEmpty(bizList)) {
|
|
|
|
@ -2227,7 +2280,7 @@ public class HlfyyyClient extends CommonHttpClient {
|
|
|
|
|
.inv_chg_type("108")
|
|
|
|
|
.fixmedins_hilist_id(item.getThrCode())
|
|
|
|
|
.fixmedins_hilist_name(item.getCpmctymc())
|
|
|
|
|
.fixmedins_bchno("0000")
|
|
|
|
|
.fixmedins_bchno(item.getOrderIdFk())
|
|
|
|
|
.pric("0")
|
|
|
|
|
.cnt(item.getActCount())
|
|
|
|
|
.rx_flag("1")
|
|
|
|
|