feat: 医保接口对接-单据上传

scpwxyy
chenhc 7 months ago
parent f83a661b3f
commit 43467ef5f0

@ -1524,15 +1524,16 @@ public class CtqyyClient extends CommonHttpClient {
*/
@Override
public BaseResponse uploadCollectOrder(PostCollectOrderRequest postCollectOrderRequest) {
String[] buyType_3501 = {"24"};
String[] buyType_3502 = {"7", "6", "5", "4", "1", "16", "12", "28", "35"};
String[] buyType_3505 = {"QXCF001","YPCF002"};
String[] buyType_3506 = {"YPTH001"};
List<IoCollectOrder> collectOrderList = postCollectOrderRequest.getCollectOrderList();
if (CollUtil.isNotEmpty(collectOrderList)) {
for (IoCollectOrder ioCollectOrder : collectOrderList) {
String busType = ioCollectOrder.getBusType();
String[] buyType_3501 = {"24"};
String[] buyType_3502 = {"7", "6", "5", "4", "1", "16", "12", "28", "35"};
String[] buyType_3505 = {"QXCF001","YPCF002"};
if (matchBusType(busType, buyType_3501)) {
optionUploadCollectOrder3501(ioCollectOrder);
@ -1540,8 +1541,10 @@ public class CtqyyClient extends CommonHttpClient {
optionUploadCollectOrder3502(ioCollectOrder);
} else if (matchBusType(busType, buyType_3505)) {
optionUploadCollectOrder3505(ioCollectOrder);
}else if (matchBusType(busType, buyType_3506)) {
optionUploadCollectOrder3506(ioCollectOrder);
} else {
return ResultVOUtils.error(500,"业务类型未找到对应上传接口");
}
}
}
@ -1851,4 +1854,59 @@ public class CtqyyClient extends CommonHttpClient {
ybClient.ybPost("3502A", dataJson);
}
}
public void optionUploadCollectOrder3506(IoCollectOrder ioCollectOrder){
List<IoCollectOrderBiz> bizList = ioCollectOrder.getBizList();
if (CollUtil.isNotEmpty(bizList)) {
List<CollectOrderBizResponse> collectOrderBizResponseList = ioCollectOrder.getCollectOrderBizResponseList();
List<Xsth3506Request> xsth3506Requests = new ArrayList<>();
for (CollectOrderBizResponse collectOrderBizResponse : collectOrderBizResponseList) {
BasicUdirelEntity basicUdirelEntity = basicUdirelDao.selectById(collectOrderBizResponse.getRelId());
String itemCode = basicUdirelEntity.getMainId();
for (IoCollectOrderBiz item : bizList) {
if (item.getNameCode().equals(itemCode)) {
String[] codes = collectOrderBizResponse.getFinishUdiCode().split(",");
List<DrugInfoRequest> drugTraceList = new ArrayList<>();
// 遍历fruits数组
for (String code : codes) {
DrugInfoRequest request = new DrugInfoRequest();
request.setDrug_trac_codg(code);
drugTraceList.add(request);
}
// TODO: 2024/9/10 字段未完全正确对应
Xsth3506Request xsth3506Request = Xsth3506Request.builder()
.med_list_codg(item.getYbbm())
.fixmedins_hilist_id(item.getThrCode())
.fixmedins_hilist_name(item.getCpmctymc())
.fixmedins_bchno("")
.setl_id(null)
.psn_no(null)
.psn_cert_type(null)
.certno(null)
.psn_name(ioCollectOrder.getFromCorp())
.manu_lotnum(item.getBatchNo())
.manu_date(item.getProductDate())
.expy_end(item.getExpireDate())
.rx_flag(null)
.trdn_flag(ioCollectOrder.getSplitStatus() == 0?"0":"1")
.finl_trns_pric(null)
.sel_retn_cnt(BigDecimal.valueOf(item.getActCount()))
.sel_retn_time(ioCollectOrder.getUpdateTime())
.sel_retn_opter_name(ioCollectOrder.getCreateUser())
.memo(item.getRemark())
.medins_prod_sel_no(null)
.mdtrt_sn(null)
.drugtracinfo(drugTraceList).build();
xsth3506Requests.add(xsth3506Request);
}
}
}
BaseXsth3506Request baseXsth3506Request = new BaseXsth3506Request();
baseXsth3506Request.setSelinfoDetail(xsth3506Requests);
String jsonStr = JSONUtil.toJsonStr(baseXsth3506Request);
JSONObject dataJson = JSONObject.parseObject(jsonStr);
ybClient.ybPost("3506A", dataJson);
}
}
}

@ -0,0 +1,10 @@
package com.glxp.mipsdl.req.yb;
import lombok.Data;
import java.util.List;
@Data
public class BaseXsth3506Request {
private List<Xsth3506Request> selinfoDetail;
}

@ -1,14 +1,21 @@
package com.glxp.mipsdl.req.yb;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 退
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Xsth3506Request {
@ -65,12 +72,12 @@ public class Xsth3506Request {
/**
*
*/
private Date manu_date;
private String manu_date;
/**
*
*/
private Date expy_end;
private String expy_end;
/**
*
@ -117,10 +124,14 @@ public class Xsth3506Request {
*/
private String mdtrt_sn;
/**
*
*/
private String drugtracinfo;
private List<DrugInfoRequest> drugtracinfo;
private String drug_trac_codg;
}

Loading…
Cancel
Save