提交 53951240 authored 作者: luzhangjian's avatar luzhangjian

feat:分页

上级 1bc2e13e
......@@ -3,12 +3,14 @@ package com.ebaiyihui.family.doctor.common.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
@EqualsAndHashCode(callSuper = true)
@Data
public class OrderDetailResDTO {
public class OrderDetailResDTO extends PageDTO {
@ApiModelProperty(value = "订单ID【必填】")
@NotBlank(message = "订单ID不能为空")
......
......@@ -2,8 +2,15 @@ package com.ebaiyihui.family.doctor.common.vo;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
@Data
public class GetPresListReqVO {
private String admId;
private String appCode;
@NotNull(message = "当前页不能为空")
@Min(value = 1, message = "当前页不能小于1")
private Integer pageNum = 1;
private Integer pageSize = 20;
}
......@@ -2,17 +2,21 @@ package com.ebaiyihui.family.doctor.server.controller;
import com.ebaiyihui.family.doctor.common.dto.OrderDetailResDTO;
import com.ebaiyihui.family.doctor.common.dto.OrderListReqDTO;
import com.ebaiyihui.family.doctor.common.vo.GetPresListResVO;
import com.ebaiyihui.family.doctor.common.vo.OrderDetailsResVo;
import com.ebaiyihui.family.doctor.common.vo.OrderListResVo;
import com.ebaiyihui.family.doctor.server.service.OrderManagementService;
import com.ebaiyihui.family.doctor.server.util.PageUtil;
import com.ebaiyihui.framework.response.BaseResponse;
import com.ebaiyihui.imforward.client.vo.IMSingleMsgResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 问诊订单管理
*/
......@@ -38,4 +42,16 @@ public class OrderManagementController {
return orderManagementService.getOrderDetails(param);
}
@ApiOperation("订单详情-处方分页")
@PostMapping("/v1/getPrePage")
public BaseResponse<PageUtil<GetPresListResVO>> getPrePage(@RequestBody OrderDetailResDTO param) {
return orderManagementService.getPrePage(param);
}
@ApiOperation("订单详情-聊天记录分页")
@PostMapping("/v1/getChatPage")
public BaseResponse<PageUtil<IMSingleMsgResultVO>> getChatPage(@RequestBody OrderDetailResDTO param) {
return orderManagementService.getChatPage(param);
}
}
......@@ -3,14 +3,22 @@ package com.ebaiyihui.family.doctor.server.service;
import com.ebaiyihui.family.doctor.common.dto.OrderDetailResDTO;
import com.ebaiyihui.family.doctor.common.dto.OrderListReqDTO;
import com.ebaiyihui.family.doctor.common.vo.GetPresListResVO;
import com.ebaiyihui.family.doctor.common.vo.OrderDetailsResVo;
import com.ebaiyihui.family.doctor.common.vo.OrderListResVo;
import com.ebaiyihui.family.doctor.server.util.PageUtil;
import com.ebaiyihui.framework.response.BaseResponse;
import com.ebaiyihui.imforward.client.vo.IMSingleMsgResultVO;
import java.util.List;
public interface OrderManagementService {
BaseResponse<PageUtil<OrderListResVo>> orderList(OrderListReqDTO param);
BaseResponse<OrderDetailsResVo> getOrderDetails(OrderDetailResDTO param);
BaseResponse<PageUtil<GetPresListResVO>> getPrePage(OrderDetailResDTO param);
BaseResponse<PageUtil<IMSingleMsgResultVO>> getChatPage(OrderDetailResDTO param);
}
......@@ -69,27 +69,44 @@ public class OrderManagementServiceImpl implements OrderManagementService {
return BaseResponse.error("订单不存在");
}
// 处方信息
resVo.setPresListResVOS(getPresList(patientSignEntity.getAdmId()));
// resVo.setPresListResVOS(getPresList(patientSignEntity.getAdmId()));
// 订单信息
resVo.setOrderInfo(buildOrderInfo(patientSignEntity));
// 沟通记录
resVo.setImSingleMsgResultVOS(queryImMsg(patientSignEntity));
// resVo.setImSingleMsgResultVOS(queryImMsg(patientSignEntity));
return BaseResponse.success(resVo);
}
@Override
public BaseResponse<PageUtil<GetPresListResVO>> getPrePage(OrderDetailResDTO param) {
List<GetPresListResVO> presList = getPresList(param.getOrderId(), param.getPageNum(), param.getPageSize());
PageUtil<GetPresListResVO> pageUtil = new PageUtil<>();
pageUtil.setList(presList);
return BaseResponse.success(pageUtil);
}
@Override
public BaseResponse<PageUtil<IMSingleMsgResultVO>> getChatPage(OrderDetailResDTO param) {
PatientSignEntity patientSignEntity = patientSignMapper.selectById(param.getOrderId());
List<IMSingleMsgResultVO> msgResultVOS = queryImMsg(patientSignEntity, param.getPageNum(), param.getPageSize());
PageUtil<IMSingleMsgResultVO> pageUtil = new PageUtil<>();
pageUtil.setList(msgResultVOS);
return BaseResponse.success(pageUtil);
}
/**
* 获取聊天记录
*/
private List<IMSingleMsgResultVO> queryImMsg(PatientSignEntity patientSignEntity){
private List<IMSingleMsgResultVO> queryImMsg(PatientSignEntity patientSignEntity,Integer pageNum,Integer pageSize){
List<IMSingleMsgResultVO> imSingleMsgResultVOS = new ArrayList<>();
IMQueryMsgReqVO reqVO = new IMQueryMsgReqVO();
List<String> admIdList = new ArrayList<>();
admIdList.add(patientSignEntity.getAdmId());
reqVO.setAppointmentId(admIdList);
reqVO.setBusinessCode("jtys");
reqVO.setPage(0);
reqVO.setPageSize(9999);
reqVO.setPage(pageNum-1);
reqVO.setPageSize(pageSize);
reqVO.setMsgType("1");
reqVO.setUserId(patientSignEntity.getPatientUserId());
......@@ -148,9 +165,11 @@ public class OrderManagementServiceImpl implements OrderManagementService {
/**
* 获取处方信息
*/
private List<GetPresListResVO> getPresList(String admId) {
private List<GetPresListResVO> getPresList(String admId,Integer pageNum,Integer pageSize) {
GetPresListReqVO reqVo = new GetPresListReqVO();
reqVo.setAdmId(admId);
reqVo.setPageNum(pageNum);
reqVo.setPageSize(pageSize);
try {
log.info("查询处方列表URL:{},入参{}, ", projProperties.getPresListByAdmId(), JSON.toJSONString(reqVo));
String body = HttpKit.jsonPost(projProperties.getPresListByAdmId(), JSON.toJSONString(reqVo));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论