JAVA全系列 教程
3762个小节阅读:7089.7k
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
序号 | 接口名称 | 接口地址 | 请求类型 |
---|---|---|---|
1 | 查询已支付的处方单 | /doctor/backfee/getChargedCareHistoryByRegId/{regId} | get |
2 | 创建现金退费订单 | /doctor/backfee/createOrderBackfeeWithCash | post |
3 | 创建支付宝退费订单 | /doctor/backfee/createOrderBackfeeWithZfb | post |
参数名称 | 是否必须 |
---|---|
regId | 是 |
返回JSON数据
名称 | 类型 | 其他信息 |
---|---|---|
msg | String | |
code | int | |
data | object | |
├─ careOrders | object [] | item 类型: object |
├─ coId | String | |
├─ coType | String | |
├─ userId | int | |
├─ patientId | String | |
├─ patientName | String | |
├─ chId | String | |
├─ allAmount | int | |
├─ createBy | String | |
├─ createTime | String | |
├─ updateBy | String | |
├─ updateTime | null | |
├─ careOrderItems | object [] | item 类型: object |
├─ itemId | String | |
├─ coId | String | |
├─ itemRefId | String | |
├─ itemName | String | |
├─ itemType | String | |
├─ num | int | |
├─ price | int | |
├─ amount | int | |
├─ remark | String | |
├─ status | String | |
├─ createTime | String | |
├─ careHistory | object | |
├─ chId | String | |
├─ userId | int | |
├─ userName | String | |
├─ patientId | String | |
├─ patientName | String | |
├─ deptId | int | |
├─ deptName | String | |
├─ receiveType | String | |
├─ isContagious | String | |
├─ careDate | String | |
├─ caseDate | String | |
├─ regId | String | |
├─ caseTitle | String | |
├─ caseResult | String | |
├─ doctorTips | String | |
├─ remark | String |
创建CareOrder、CareOrderItem
xxxxxxxxxx
package com.bjsxt.domain;
import ...
/**
* 药用处方表
*/
value="com-bjsxt-domain-CareOrder") (
callSuper=true) (
value = "his_care_order") (
public class CareOrder extends BaseEntity {
/**
* 处方ID
*/
value = "co_id", type = IdType.INPUT) (
value="处方ID") (
private String coId;
/**
* 处方类型0药用处方1检查处方
*/
value = "co_type") (
value="处方类型0药用处方1检查处方") (
private String coType;
/**
* 医生id
*/
value = "user_id") (
value="医生id") (
private Long userId;
/**
* 患者id
*/
value = "patient_id") (
value="患者id") (
private String patientId;
/**
* 患者姓名
*/
value = "patient_name") (
value="患者姓名") (
private String patientName;
/**
* 关联病历id
*/
value = "ch_id") (
value="关联病历id") (
private String chId;
/**
* 处方全额
*/
value = "all_amount") (
value="处方全额") (
private BigDecimal allAmount;
/**
* 创建者
*/
value = "create_by") (
value="创建者") (
private String createBy;
/**
* 创建时间
*/
value = "create_time") (
value="创建时间") (
private Date createTime;
/**
* 更新者
*/
value = "update_by") (
value="更新者") (
private String updateBy;
/**
* 更新时间
*/
value = "update_time") (
value="更新时间") (
private Date updateTime;
public static final String COL_CO_ID = "co_id";
public static final String COL_CO_TYPE = "co_type";
public static final String COL_USER_ID = "user_id";
public static final String COL_PATIENT_ID = "patient_id";
public static final String COL_PATIENT_NAME = "patient_name";
public static final String COL_CH_ID = "ch_id";
public static final String COL_ALL_AMOUNT = "all_amount";
public static final String COL_CREATE_BY = "create_by";
public static final String COL_CREATE_TIME = "create_time";
public static final String COL_UPDATE_BY = "update_by";
public static final String COL_UPDATE_TIME = "update_time";
}
xxxxxxxxxx
package com.bjsxt.domain;
import ...
/**
* 开诊细表
*/
value="com-bjsxt-domain-CareOrderItem") (
callSuper=true) (
value = "his_care_order_item") (
public class CareOrderItem extends BaseEntity {
/**
* 开诊明细ID
*/
value = "item_id", type = IdType.INPUT) (
value="开诊明细ID") (
private String itemId;
/**
* 所属处方id
*/
value = "co_id") (
value="所属处方id") (
private String coId;
/**
* 药品或者检查项目id
*/
value = "item_ref_id") (
value="药品或者检查项目id") (
private String itemRefId;
/**
* 药品或检查项目名称
*/
value = "item_name") (
value="药品或检查项目名称") (
private String itemName;
/**
* 项目类型0药品 还是1检查项
*/
value = "item_type") (
value="项目类型0药品 还是1检查项") (
private String itemType;
/**
* 数量
*/
value = "num") (
value="数量") (
private BigDecimal num;
/**
* 单价
*/
value = "price") (
value="单价") (
private BigDecimal price;
/**
* 金额
*/
value = "amount") (
value="金额") (
private BigDecimal amount;
/**
* 备注
*/
value = "remark") (
value="备注") (
private String remark;
/**
* 状态,0未支付,1已支付,2,已退费 3,已完成 字典表his_order_details_status
*/
value = "status") (
value="状态,0未支付,1已支付,2,已退费 3,已完成 字典表his_order_details_status") (
private String status;
/**
* 创建时间
*/
value = "create_time") (
value="创建时间") (
private Date createTime;
public static final String COL_ITEM_ID = "item_id";
public static final String COL_CO_ID = "co_id";
public static final String COL_ITEM_REF_ID = "item_ref_id";
public static final String COL_ITEM_NAME = "item_name";
public static final String COL_ITEM_TYPE = "item_type";
public static final String COL_NUM = "num";
public static final String COL_PRICE = "price";
public static final String COL_AMOUNT = "amount";
public static final String COL_REMARK = "remark";
public static final String COL_STATUS = "status";
public static final String COL_CREATE_TIME = "create_time";
}
创建CareOrderMapper、CareOrderMapper.xml
xxxxxxxxxx
package com.bjsxt.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bjsxt.domain.CareOrder;
public interface CareOrderMapper extends BaseMapper<CareOrder> {
}
xxxxxxxxxx
<mapper namespace="com.bjsxt.mapper.CareOrderMapper">
<resultMap id="BaseResultMap" type="com.bjsxt.domain.CareOrder">
<!--@mbg.generated-->
<!--@Table his_care_order-->
<id column="co_id" jdbcType="VARCHAR" property="coId" />
<result column="co_type" jdbcType="CHAR" property="coType" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="patient_id" jdbcType="VARCHAR" property="patientId" />
<result column="patient_name" jdbcType="VARCHAR" property="patientName" />
<result column="ch_id" jdbcType="VARCHAR" property="chId" />
<result column="all_amount" jdbcType="DECIMAL" property="allAmount" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
co_id, co_type, user_id, patient_id, patient_name, ch_id, all_amount, create_by,
create_time, update_by, update_time
</sql>
</mapper>
在CareService中增加以下方法
xxxxxxxxxx
/**
* 根据挂号单位ID查询对应的病历信息
* @param regId
* @return
*/
CareHistory queryCareHistoryByRegId(String regId);
在CareServiceImpl中增加方法实现
xxxxxxxxxx
public CareHistory queryCareHistoryByRegId(String regId) {
QueryWrapper<CareHistory> qw=new QueryWrapper<>();
qw.eq(CareHistory.COL_REG_ID,regId);
return this.careHistoryMapper.selectOne(qw);
}
在OrderBackfeeController中增加以下方法
xxxxxxxxxx
/**
* 根据挂号ID查询未支付的处方信息及详情
*/
"getChargedCareHistoryByRegId/{regId}") (
public AjaxResult getChargedCareHistoryByRegId( String regId){
//声明返回的Map对象
Map<String,Object> res=new HashMap<>();
//根据挂号单ID查询病例信息
CareHistory careHistory=this.careService.queryCareHistoryByRegId(regId);
if(null==careHistory){
return AjaxResult.fail("【"+regId+"】的挂号单没有对应的病例信息,请核对后再查询");
}
//放入默认值
res.put("careHistory",careHistory);
res.put("careOrders", Collections.EMPTY_LIST);
//声明一个可以存放careOrders的集合
List<Map<String,Object>> mapList=new ArrayList<>();
//根据病例编号查询处方
List<CareOrder> careOrders=this.careService.queryCareOrdersByChId(careHistory.getChId());
if(careOrders.isEmpty()){
return AjaxResult.fail("【"+regId+"】的挂号单没相关的处方信息,请核对后再查询");
}
for (CareOrder careOrder : careOrders) {
Map<String,Object> beanToMap= BeanUtil.beanToMap(careOrder);
beanToMap.put("careOrderItems",Collections.EMPTY_LIST);
BigDecimal allAmount=new BigDecimal("0");
//根据处方ID查询未支付的处方详情列表
List<CareOrderItem> careOrderItems=this.careService.queryCareOrderItemsByCoId(careOrder.getCoId(), Constants.ORDER_DETAILS_STATUS_1);
//如果当前处方未支付的详情为空 结束当前循环
if(careOrderItems.isEmpty()){
continue;
}else{
//重新计算总价
for (CareOrderItem careOrderItem : careOrderItems) {
allAmount=allAmount.add(careOrderItem.getAmount());
}
beanToMap.put("careOrderItems",careOrderItems);
beanToMap.put("allAmount",allAmount);
mapList.add(beanToMap);
}
}
if(mapList.isEmpty()){
return AjaxResult.fail("【"+regId+"】的挂号单没已支付的处方信息,请核对后再查询");
}else{
res.put("careOrders",mapList);
return AjaxResult.success(res);
}
}
/doctor/backfee/getChargedCareHistoryByRegId/