feat(clinic): 新增医生和患者关联信息及处方明细功能
- 在预约实体中增加医生名称、患者昵称和手机号字段 - 在医生用户实体中增加昵称、头像、部门、专业领域等字段 - 在患者实体中增加性别、年龄、身高、体重和过敏史字段 - 修改处方主表和明细表,增加文件附件和药品相关信息 - 更新相关Mapper XML文件,完善关联查询SQL语句 -优化医生用户和患者查询参数类,调整字段结构 - 在处方服务中实现关联明细数据的查询逻辑 -为处方和明细参数类添加ID集合查询支持
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
package com.gxwebsoft.clinic.controller;
|
package com.gxwebsoft.clinic.controller;
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.clinic.service.ClinicDoctorUserService;
|
|
||||||
import com.gxwebsoft.clinic.entity.ClinicDoctorUser;
|
import com.gxwebsoft.clinic.entity.ClinicDoctorUser;
|
||||||
import com.gxwebsoft.clinic.param.ClinicDoctorUserParam;
|
import com.gxwebsoft.clinic.param.ClinicDoctorUserParam;
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
import com.gxwebsoft.clinic.service.ClinicDoctorUserService;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@@ -21,7 +21,7 @@ import java.util.List;
|
|||||||
* 分销商用户记录表控制器
|
* 分销商用户记录表控制器
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2025-10-19 09:27:04
|
* @since 2025-10-23 15:58:21
|
||||||
*/
|
*/
|
||||||
@Tag(name = "分销商用户记录表管理")
|
@Tag(name = "分销商用户记录表管理")
|
||||||
@RestController
|
@RestController
|
||||||
@@ -30,6 +30,7 @@ public class ClinicDoctorUserController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private ClinicDoctorUserService clinicDoctorUserService;
|
private ClinicDoctorUserService clinicDoctorUserService;
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:list')")
|
||||||
@Operation(summary = "分页查询分销商用户记录表")
|
@Operation(summary = "分页查询分销商用户记录表")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public ApiResult<PageResult<ClinicDoctorUser>> page(ClinicDoctorUserParam param) {
|
public ApiResult<PageResult<ClinicDoctorUser>> page(ClinicDoctorUserParam param) {
|
||||||
@@ -45,6 +46,7 @@ public class ClinicDoctorUserController extends BaseController {
|
|||||||
return success(clinicDoctorUserService.listRel(param));
|
return success(clinicDoctorUserService.listRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('clinic:clinicDoctorUser:list')")
|
||||||
@Operation(summary = "根据id查询分销商用户记录表")
|
@Operation(summary = "根据id查询分销商用户记录表")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ApiResult<ClinicDoctorUser> get(@PathVariable("id") Integer id) {
|
public ApiResult<ClinicDoctorUser> get(@PathVariable("id") Integer id) {
|
||||||
@@ -57,6 +59,11 @@ public class ClinicDoctorUserController extends BaseController {
|
|||||||
@Operation(summary = "添加分销商用户记录表")
|
@Operation(summary = "添加分销商用户记录表")
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody ClinicDoctorUser clinicDoctorUser) {
|
public ApiResult<?> save(@RequestBody ClinicDoctorUser clinicDoctorUser) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
clinicDoctorUser.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
if (clinicDoctorUserService.save(clinicDoctorUser)) {
|
if (clinicDoctorUserService.save(clinicDoctorUser)) {
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.gxwebsoft.clinic.entity;
|
package com.gxwebsoft.clinic.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -38,9 +39,21 @@ public class ClinicAppointment implements Serializable {
|
|||||||
@Schema(description = "医生")
|
@Schema(description = "医生")
|
||||||
private Integer doctorId;
|
private Integer doctorId;
|
||||||
|
|
||||||
|
@Schema(description = "医生名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String doctorName;
|
||||||
|
|
||||||
@Schema(description = "患者")
|
@Schema(description = "患者")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "患者名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "手机")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String phone;
|
||||||
|
|
||||||
@Schema(description = "备注")
|
@Schema(description = "备注")
|
||||||
private String comments;
|
private String comments;
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,22 @@
|
|||||||
package com.gxwebsoft.clinic.entity;
|
package com.gxwebsoft.clinic.entity;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import java.time.LocalDateTime;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import java.io.Serializable;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分销商用户记录表
|
* 分销商用户记录表
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2025-10-19 09:27:04
|
* @since 2025-10-23 15:58:20
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@@ -32,41 +34,44 @@ public class ClinicDoctorUser implements Serializable {
|
|||||||
@Schema(description = "自增ID")
|
@Schema(description = "自增ID")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "昵称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@Schema(description = "头像")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
@Schema(description = "姓名")
|
@Schema(description = "姓名")
|
||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
@Schema(description = "手机号")
|
@Schema(description = "手机号")
|
||||||
private String mobile;
|
@TableField(exist = false)
|
||||||
|
private String phone;
|
||||||
|
|
||||||
@Schema(description = "支付密码")
|
@Schema(description = "部门")
|
||||||
private String payPassword;
|
private Integer departmentId;
|
||||||
|
|
||||||
@Schema(description = "当前可提现佣金")
|
@Schema(description = "专业领域")
|
||||||
private BigDecimal money;
|
private String specialty;
|
||||||
|
|
||||||
@Schema(description = "已冻结佣金")
|
@Schema(description = "职务级别")
|
||||||
private BigDecimal freezeMoney;
|
private String position;
|
||||||
|
|
||||||
@Schema(description = "累积提现佣金")
|
@Schema(description = "执业资格")
|
||||||
private BigDecimal totalMoney;
|
private String qualification;
|
||||||
|
|
||||||
@Schema(description = "收益基数")
|
@Schema(description = "医生简介")
|
||||||
private BigDecimal rate;
|
private String introduction;
|
||||||
|
|
||||||
@Schema(description = "单价")
|
@Schema(description = "挂号费")
|
||||||
private BigDecimal price;
|
private BigDecimal consultationFee;
|
||||||
|
|
||||||
@Schema(description = "推荐人用户ID")
|
@Schema(description = "工作年限")
|
||||||
private Integer refereeId;
|
private Integer workYears;
|
||||||
|
|
||||||
@Schema(description = "成员数量(一级)")
|
@Schema(description = "问诊人数")
|
||||||
private Integer firstNum;
|
private Integer consultationCount;
|
||||||
|
|
||||||
@Schema(description = "成员数量(二级)")
|
|
||||||
private Integer secondNum;
|
|
||||||
|
|
||||||
@Schema(description = "成员数量(三级)")
|
|
||||||
private Integer thirdNum;
|
|
||||||
|
|
||||||
@Schema(description = "专属二维码")
|
@Schema(description = "专属二维码")
|
||||||
private String qrcode;
|
private String qrcode;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.gxwebsoft.clinic.entity;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -36,37 +37,25 @@ public class ClinicPatientUser implements Serializable {
|
|||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
@Schema(description = "手机号")
|
@Schema(description = "手机号")
|
||||||
|
@TableField(exist = false)
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
@Schema(description = "支付密码")
|
@Schema(description = "性别 0未知 1男 2女")
|
||||||
private String payPassword;
|
@TableField(exist = false)
|
||||||
|
private String sex;
|
||||||
|
|
||||||
@Schema(description = "当前可提现佣金")
|
@Schema(description = "年龄")
|
||||||
private BigDecimal money;
|
@TableField(exist = false)
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
@Schema(description = "已冻结佣金")
|
@Schema(description = "身高")
|
||||||
private BigDecimal freezeMoney;
|
private String height;
|
||||||
|
|
||||||
@Schema(description = "累积提现佣金")
|
@Schema(description = "体重")
|
||||||
private BigDecimal totalMoney;
|
private String weight;
|
||||||
|
|
||||||
@Schema(description = "收益基数")
|
@Schema(description = "过敏史")
|
||||||
private BigDecimal rate;
|
private String allergyHistory;
|
||||||
|
|
||||||
@Schema(description = "单价")
|
|
||||||
private BigDecimal price;
|
|
||||||
|
|
||||||
@Schema(description = "推荐人用户ID")
|
|
||||||
private Integer refereeId;
|
|
||||||
|
|
||||||
@Schema(description = "成员数量(一级)")
|
|
||||||
private Integer firstNum;
|
|
||||||
|
|
||||||
@Schema(description = "成员数量(二级)")
|
|
||||||
private Integer secondNum;
|
|
||||||
|
|
||||||
@Schema(description = "成员数量(三级)")
|
|
||||||
private Integer thirdNum;
|
|
||||||
|
|
||||||
@Schema(description = "专属二维码")
|
@Schema(description = "专属二维码")
|
||||||
private String qrcode;
|
private String qrcode;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.gxwebsoft.clinic.entity;
|
package com.gxwebsoft.clinic.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@@ -10,6 +11,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处方主表
|
* 处方主表
|
||||||
@@ -52,6 +54,9 @@ public class ClinicPrescription implements Serializable {
|
|||||||
@Schema(description = "煎药说明")
|
@Schema(description = "煎药说明")
|
||||||
private String decoctionInstructions;
|
private String decoctionInstructions;
|
||||||
|
|
||||||
|
@Schema(description = "上传附件")
|
||||||
|
private String files;
|
||||||
|
|
||||||
@Schema(description = "订单总金额")
|
@Schema(description = "订单总金额")
|
||||||
private BigDecimal orderPrice;
|
private BigDecimal orderPrice;
|
||||||
|
|
||||||
@@ -88,4 +93,8 @@ public class ClinicPrescription implements Serializable {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
private LocalDateTime updateTime;
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "处方明细")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<ClinicPrescriptionItem> items;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.gxwebsoft.clinic.entity;
|
package com.gxwebsoft.clinic.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@@ -37,6 +38,26 @@ public class ClinicPrescriptionItem implements Serializable {
|
|||||||
@Schema(description = "关联药品")
|
@Schema(description = "关联药品")
|
||||||
private Integer medicineId;
|
private Integer medicineId;
|
||||||
|
|
||||||
|
@Schema(description = "药品名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String medicineName;
|
||||||
|
|
||||||
|
@Schema(description = "规格")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String specification;
|
||||||
|
|
||||||
|
@Schema(description = "单位")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "单价")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private BigDecimal pricePerUnit;
|
||||||
|
|
||||||
|
@Schema(description = "药品")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private ClinicMedicine clinicMedicine;
|
||||||
|
|
||||||
@Schema(description = "剂量(如“10g”)")
|
@Schema(description = "剂量(如“10g”)")
|
||||||
private String dosage;
|
private String dosage;
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,10 @@
|
|||||||
|
|
||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*
|
SELECT a.*, b.nickname, b.phone, c.real_name as doctorName
|
||||||
FROM clinic_appointment a
|
FROM clinic_appointment a
|
||||||
|
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
|
||||||
|
LEFT JOIN clinic_doctor_user c ON a.doctor_id = c.user_id
|
||||||
<where>
|
<where>
|
||||||
<if test="param.id != null">
|
<if test="param.id != null">
|
||||||
AND a.id = #{param.id}
|
AND a.id = #{param.id}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*
|
SELECT a.*, b.nickname, b.phone, b.avatar
|
||||||
FROM clinic_doctor_user a
|
FROM clinic_doctor_user a
|
||||||
|
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
|
||||||
<where>
|
<where>
|
||||||
<if test="param.id != null">
|
<if test="param.id != null">
|
||||||
AND a.id = #{param.id}
|
AND a.id = #{param.id}
|
||||||
@@ -19,38 +20,32 @@
|
|||||||
<if test="param.realName != null">
|
<if test="param.realName != null">
|
||||||
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="param.mobile != null">
|
<if test="param.phone != null">
|
||||||
AND a.mobile LIKE CONCAT('%', #{param.mobile}, '%')
|
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="param.payPassword != null">
|
<if test="param.departmentId != null">
|
||||||
AND a.pay_password LIKE CONCAT('%', #{param.payPassword}, '%')
|
AND a.department_id = #{param.departmentId}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.money != null">
|
<if test="param.specialty != null">
|
||||||
AND a.money = #{param.money}
|
AND a.specialty LIKE CONCAT('%', #{param.specialty}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="param.freezeMoney != null">
|
<if test="param.position != null">
|
||||||
AND a.freeze_money = #{param.freezeMoney}
|
AND a.position LIKE CONCAT('%', #{param.position}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="param.totalMoney != null">
|
<if test="param.qualification != null">
|
||||||
AND a.total_money = #{param.totalMoney}
|
AND a.qualification LIKE CONCAT('%', #{param.qualification}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="param.rate != null">
|
<if test="param.introduction != null">
|
||||||
AND a.rate = #{param.rate}
|
AND a.introduction LIKE CONCAT('%', #{param.introduction}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="param.price != null">
|
<if test="param.consultationFee != null">
|
||||||
AND a.price = #{param.price}
|
AND a.consultation_fee = #{param.consultationFee}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.refereeId != null">
|
<if test="param.workYears != null">
|
||||||
AND a.referee_id = #{param.refereeId}
|
AND a.work_years = #{param.workYears}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.firstNum != null">
|
<if test="param.consultationCount != null">
|
||||||
AND a.first_num = #{param.firstNum}
|
AND a.consultation_count = #{param.consultationCount}
|
||||||
</if>
|
|
||||||
<if test="param.secondNum != null">
|
|
||||||
AND a.second_num = #{param.secondNum}
|
|
||||||
</if>
|
|
||||||
<if test="param.thirdNum != null">
|
|
||||||
AND a.third_num = #{param.thirdNum}
|
|
||||||
</if>
|
</if>
|
||||||
<if test="param.qrcode != null">
|
<if test="param.qrcode != null">
|
||||||
AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%')
|
AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%')
|
||||||
@@ -72,6 +67,7 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="param.keywords != null">
|
<if test="param.keywords != null">
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR a.real_name = #{param.keywords}
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
@@ -2,89 +2,70 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.gxwebsoft.clinic.mapper.ClinicPatientUserMapper">
|
<mapper namespace="com.gxwebsoft.clinic.mapper.ClinicPatientUserMapper">
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*
|
SELECT a.*, b.phone, b.sex, b.age
|
||||||
FROM clinic_patient_user a
|
FROM clinic_patient_user a
|
||||||
<where>
|
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
|
||||||
<if test="param.id != null">
|
<where>
|
||||||
AND a.id = #{param.id}
|
<if test="param.id != null">
|
||||||
</if>
|
AND a.id = #{param.id}
|
||||||
<if test="param.type != null">
|
</if>
|
||||||
AND a.type = #{param.type}
|
<if test="param.type != null">
|
||||||
</if>
|
AND a.type = #{param.type}
|
||||||
<if test="param.userId != null">
|
</if>
|
||||||
AND a.user_id = #{param.userId}
|
<if test="param.userId != null">
|
||||||
</if>
|
AND a.user_id = #{param.userId}
|
||||||
<if test="param.realName != null">
|
</if>
|
||||||
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
<if test="param.realName != null">
|
||||||
</if>
|
AND a.real_name LIKE CONCAT('%', #{param.realName}, '%')
|
||||||
<if test="param.phone != null">
|
</if>
|
||||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
<if test="param.age != null">
|
||||||
</if>
|
AND a.age LIKE CONCAT('%', #{param.age}, '%')
|
||||||
<if test="param.payPassword != null">
|
</if>
|
||||||
AND a.pay_password LIKE CONCAT('%', #{param.payPassword}, '%')
|
<if test="param.qrcode != null">
|
||||||
</if>
|
AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%')
|
||||||
<if test="param.money != null">
|
</if>
|
||||||
AND a.money = #{param.money}
|
<if test="param.height != null">
|
||||||
</if>
|
AND a.height LIKE CONCAT('%', #{param.height}, '%')
|
||||||
<if test="param.freezeMoney != null">
|
</if>
|
||||||
AND a.freeze_money = #{param.freezeMoney}
|
<if test="param.weight != null">
|
||||||
</if>
|
AND a.weight LIKE CONCAT('%', #{param.weight}, '%')
|
||||||
<if test="param.totalMoney != null">
|
</if>
|
||||||
AND a.total_money = #{param.totalMoney}
|
<if test="param.allergyHistory != null">
|
||||||
</if>
|
AND a.allergy_history LIKE CONCAT('%', #{param.allergyHistory}, '%')
|
||||||
<if test="param.rate != null">
|
</if>
|
||||||
AND a.rate = #{param.rate}
|
<if test="param.comments != null">
|
||||||
</if>
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
<if test="param.price != null">
|
</if>
|
||||||
AND a.price = #{param.price}
|
<if test="param.sortNumber != null">
|
||||||
</if>
|
AND a.sort_number = #{param.sortNumber}
|
||||||
<if test="param.refereeId != null">
|
</if>
|
||||||
AND a.referee_id = #{param.refereeId}
|
<if test="param.isDelete != null">
|
||||||
</if>
|
AND a.is_delete = #{param.isDelete}
|
||||||
<if test="param.firstNum != null">
|
</if>
|
||||||
AND a.first_num = #{param.firstNum}
|
<if test="param.createTimeStart != null">
|
||||||
</if>
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
<if test="param.secondNum != null">
|
</if>
|
||||||
AND a.second_num = #{param.secondNum}
|
<if test="param.createTimeEnd != null">
|
||||||
</if>
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
<if test="param.thirdNum != null">
|
</if>
|
||||||
AND a.third_num = #{param.thirdNum}
|
<if test="param.keywords != null">
|
||||||
</if>
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
<if test="param.qrcode != null">
|
OR a.real_name = #{param.keywords}
|
||||||
AND a.qrcode LIKE CONCAT('%', #{param.qrcode}, '%')
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="param.comments != null">
|
</where>
|
||||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
</sql>
|
||||||
</if>
|
|
||||||
<if test="param.sortNumber != null">
|
|
||||||
AND a.sort_number = #{param.sortNumber}
|
|
||||||
</if>
|
|
||||||
<if test="param.isDelete != null">
|
|
||||||
AND a.is_delete = #{param.isDelete}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeStart != null">
|
|
||||||
AND a.create_time >= #{param.createTimeStart}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeEnd != null">
|
|
||||||
AND a.create_time <= #{param.createTimeEnd}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
<!-- 分页查询 -->
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.clinic.entity.ClinicPatientUser">
|
<select id="selectPageRel" resultType="com.gxwebsoft.clinic.entity.ClinicPatientUser">
|
||||||
<include refid="selectSql"></include>
|
<include refid="selectSql"></include>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
<!-- 查询全部 -->
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.clinic.entity.ClinicPatientUser">
|
<select id="selectListRel" resultType="com.gxwebsoft.clinic.entity.ClinicPatientUser">
|
||||||
<include refid="selectSql"></include>
|
<include refid="selectSql"></include>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*
|
SELECT a.*, b.name AS medicineName, b.specification, b.unit, b.price_per_unit AS pricePerUnit
|
||||||
FROM clinic_prescription_item a
|
FROM clinic_prescription_item a
|
||||||
|
LEFT JOIN clinic_medicine b ON a.id = b.id
|
||||||
<where>
|
<where>
|
||||||
<if test="param.id != null">
|
<if test="param.id != null">
|
||||||
AND a.id = #{param.id}
|
AND a.id = #{param.id}
|
||||||
|
|||||||
@@ -49,6 +49,12 @@
|
|||||||
<if test="param.isSettled != null">
|
<if test="param.isSettled != null">
|
||||||
AND a.is_settled = #{param.isSettled}
|
AND a.is_settled = #{param.isSettled}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.ids != null">
|
||||||
|
AND a.id IN
|
||||||
|
<foreach collection="param.ids" item="item" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="param.settleTime != null">
|
<if test="param.settleTime != null">
|
||||||
AND a.settle_time LIKE CONCAT('%', #{param.settleTime}, '%')
|
AND a.settle_time LIKE CONCAT('%', #{param.settleTime}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
package com.gxwebsoft.clinic.param;
|
package com.gxwebsoft.clinic.param;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分销商用户记录表查询参数
|
* 分销商用户记录表查询参数
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2025-10-19 09:27:04
|
* @since 2025-10-23 15:58:20
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@@ -38,46 +39,35 @@ public class ClinicDoctorUserParam extends BaseParam {
|
|||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
@Schema(description = "手机号")
|
@Schema(description = "手机号")
|
||||||
private String mobile;
|
private String phone;
|
||||||
|
|
||||||
@Schema(description = "支付密码")
|
@Schema(description = "部门")
|
||||||
private String payPassword;
|
|
||||||
|
|
||||||
@Schema(description = "当前可提现佣金")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private BigDecimal money;
|
private Integer departmentId;
|
||||||
|
|
||||||
@Schema(description = "已冻结佣金")
|
@Schema(description = "专业领域")
|
||||||
@QueryField(type = QueryType.EQ)
|
private String specialty;
|
||||||
private BigDecimal freezeMoney;
|
|
||||||
|
|
||||||
@Schema(description = "累积提现佣金")
|
@Schema(description = "职务级别")
|
||||||
@QueryField(type = QueryType.EQ)
|
private String position;
|
||||||
private BigDecimal totalMoney;
|
|
||||||
|
|
||||||
@Schema(description = "收益基数")
|
@Schema(description = "执业资格")
|
||||||
@QueryField(type = QueryType.EQ)
|
private String qualification;
|
||||||
private BigDecimal rate;
|
|
||||||
|
|
||||||
@Schema(description = "单价")
|
@Schema(description = "医生简介")
|
||||||
@QueryField(type = QueryType.EQ)
|
private String introduction;
|
||||||
private BigDecimal price;
|
|
||||||
|
|
||||||
@Schema(description = "推荐人用户ID")
|
@Schema(description = "挂号费")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer refereeId;
|
private BigDecimal consultationFee;
|
||||||
|
|
||||||
@Schema(description = "成员数量(一级)")
|
@Schema(description = "工作年限")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer firstNum;
|
private Integer workYears;
|
||||||
|
|
||||||
@Schema(description = "成员数量(二级)")
|
@Schema(description = "问诊人数")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer secondNum;
|
private Integer consultationCount;
|
||||||
|
|
||||||
@Schema(description = "成员数量(三级)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer thirdNum;
|
|
||||||
|
|
||||||
@Schema(description = "专属二维码")
|
@Schema(description = "专属二维码")
|
||||||
private String qrcode;
|
private String qrcode;
|
||||||
|
|||||||
@@ -13,84 +13,54 @@ import lombok.EqualsAndHashCode;
|
|||||||
* 患者查询参数
|
* 患者查询参数
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2025-10-19 09:27:04
|
* @since 2025-10-23 15:27:17
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
@Schema(name = "ClinicPatientUserParam对象", description = "患者查询参数")
|
@Schema(name = "ClinicPatientUserParam对象", description = "患者查询参数")
|
||||||
public class ClinicPatientUserParam extends BaseParam {
|
public class ClinicPatientUserParam extends BaseParam {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Schema(description = "主键ID")
|
@Schema(description = "主键ID")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
@Schema(description = "类型 0经销商 1企业 2集团")
|
@Schema(description = "类型 0经销商 1企业 2集团")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@Schema(description = "自增ID")
|
@Schema(description = "自增ID")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
@Schema(description = "姓名")
|
@Schema(description = "姓名")
|
||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
@Schema(description = "手机号")
|
@Schema(description = "年龄")
|
||||||
private String phone;
|
private String age;
|
||||||
|
|
||||||
@Schema(description = "支付密码")
|
@Schema(description = "专属二维码")
|
||||||
private String payPassword;
|
private String qrcode;
|
||||||
|
|
||||||
@Schema(description = "当前可提现佣金")
|
@Schema(description = "身高")
|
||||||
@QueryField(type = QueryType.EQ)
|
private String height;
|
||||||
private BigDecimal money;
|
|
||||||
|
|
||||||
@Schema(description = "已冻结佣金")
|
@Schema(description = "体重")
|
||||||
@QueryField(type = QueryType.EQ)
|
private String weight;
|
||||||
private BigDecimal freezeMoney;
|
|
||||||
|
|
||||||
@Schema(description = "累积提现佣金")
|
@Schema(description = "过敏史")
|
||||||
@QueryField(type = QueryType.EQ)
|
private String allergyHistory;
|
||||||
private BigDecimal totalMoney;
|
|
||||||
|
|
||||||
@Schema(description = "收益基数")
|
@Schema(description = "备注")
|
||||||
@QueryField(type = QueryType.EQ)
|
private String comments;
|
||||||
private BigDecimal rate;
|
|
||||||
|
|
||||||
@Schema(description = "单价")
|
@Schema(description = "排序号")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private BigDecimal price;
|
private Integer sortNumber;
|
||||||
|
|
||||||
@Schema(description = "推荐人用户ID")
|
@Schema(description = "是否删除")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer refereeId;
|
private Integer isDelete;
|
||||||
|
|
||||||
@Schema(description = "成员数量(一级)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer firstNum;
|
|
||||||
|
|
||||||
@Schema(description = "成员数量(二级)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer secondNum;
|
|
||||||
|
|
||||||
@Schema(description = "成员数量(三级)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer thirdNum;
|
|
||||||
|
|
||||||
@Schema(description = "专属二维码")
|
|
||||||
private String qrcode;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "排序号")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer isDelete;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gxwebsoft.clinic.param;
|
package com.gxwebsoft.clinic.param;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
@@ -9,6 +10,7 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处方明细表
|
* 处方明细表
|
||||||
@@ -72,4 +74,8 @@ public class ClinicPrescriptionItemParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
@Schema(description = "处方ID集查询")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Set<Integer> prescriptionIds;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gxwebsoft.clinic.param;
|
package com.gxwebsoft.clinic.param;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
@@ -9,6 +10,7 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处方主表
|
* 处方主表
|
||||||
@@ -86,4 +88,8 @@ public class ClinicPrescriptionParam extends BaseParam {
|
|||||||
@Schema(description = "备注")
|
@Schema(description = "备注")
|
||||||
private String comments;
|
private String comments;
|
||||||
|
|
||||||
|
@Schema(description = "处方ID集查询")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Set<Integer> ids;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,25 @@
|
|||||||
package com.gxwebsoft.clinic.service.impl;
|
package com.gxwebsoft.clinic.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gxwebsoft.clinic.entity.ClinicPrescription;
|
import com.gxwebsoft.clinic.entity.ClinicPrescription;
|
||||||
|
import com.gxwebsoft.clinic.entity.ClinicPrescriptionItem;
|
||||||
import com.gxwebsoft.clinic.mapper.ClinicPrescriptionMapper;
|
import com.gxwebsoft.clinic.mapper.ClinicPrescriptionMapper;
|
||||||
|
import com.gxwebsoft.clinic.param.ClinicPrescriptionItemParam;
|
||||||
import com.gxwebsoft.clinic.param.ClinicPrescriptionParam;
|
import com.gxwebsoft.clinic.param.ClinicPrescriptionParam;
|
||||||
|
import com.gxwebsoft.clinic.service.ClinicPrescriptionItemService;
|
||||||
import com.gxwebsoft.clinic.service.ClinicPrescriptionService;
|
import com.gxwebsoft.clinic.service.ClinicPrescriptionService;
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.ShopOrder;
|
||||||
|
import com.gxwebsoft.shop.entity.ShopOrderGoods;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处方主表
|
* 处方主表
|
||||||
@@ -21,11 +31,22 @@ Service实现
|
|||||||
@Service
|
@Service
|
||||||
public class ClinicPrescriptionServiceImpl extends ServiceImpl<ClinicPrescriptionMapper, ClinicPrescription> implements ClinicPrescriptionService {
|
public class ClinicPrescriptionServiceImpl extends ServiceImpl<ClinicPrescriptionMapper, ClinicPrescription> implements ClinicPrescriptionService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ClinicPrescriptionItemService clinicPrescriptionItemService;
|
||||||
@Override
|
@Override
|
||||||
public PageResult<ClinicPrescription> pageRel(ClinicPrescriptionParam param) {
|
public PageResult<ClinicPrescription> pageRel(ClinicPrescriptionParam param) {
|
||||||
PageParam<ClinicPrescription, ClinicPrescriptionParam> page = new PageParam<>(param);
|
PageParam<ClinicPrescription, ClinicPrescriptionParam> page = new PageParam<>(param);
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
List<ClinicPrescription> list = baseMapper.selectPageRel(page, param);
|
List<ClinicPrescription> list = baseMapper.selectPageRel(page, param);
|
||||||
|
// 查询处方明细
|
||||||
|
Set<Integer> collectIds = list.stream().map(ClinicPrescription::getId).collect(Collectors.toSet());
|
||||||
|
final ClinicPrescriptionItemParam itemParam = new ClinicPrescriptionItemParam();
|
||||||
|
itemParam.setPrescriptionIds(collectIds);
|
||||||
|
final List<ClinicPrescriptionItem> clinicPrescriptionItems = clinicPrescriptionItemService.listRel(itemParam);
|
||||||
|
final Map<Integer, List<ClinicPrescriptionItem>> collect = clinicPrescriptionItems.stream().collect(Collectors.groupingBy(ClinicPrescriptionItem::getPrescriptionId));
|
||||||
|
list.forEach(d -> {
|
||||||
|
d.setItems(collect.get(d.getId()));
|
||||||
|
});
|
||||||
return new PageResult<>(list, page.getTotal());
|
return new PageResult<>(list, page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user