小程序订单查看修改
This commit is contained in:
parent
49f8ff022f
commit
c5fcb0e0b9
@ -31,7 +31,7 @@ public class NursingOrderController extends BaseController {
|
|||||||
private INursingOrderService nursingOrderService;
|
private INursingOrderService nursingOrderService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据登录id查询订单列表
|
* 根据登录id查询订单列表(暂时不用)
|
||||||
*/
|
*/
|
||||||
@GetMapping("/userPage")
|
@GetMapping("/userPage")
|
||||||
public TableDataInfo page(Long parentId) {
|
public TableDataInfo page(Long parentId) {
|
||||||
@ -93,4 +93,16 @@ public class NursingOrderController extends BaseController {
|
|||||||
}
|
}
|
||||||
return nursingOrderService.getAppointmentDetailsInfo(orderNo);
|
return nursingOrderService.getAppointmentDetailsInfo(orderNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据openid编号查询对应得订单
|
||||||
|
*/
|
||||||
|
@MobileRequestAuthorization
|
||||||
|
@GetMapping("/getAppletOrderList")
|
||||||
|
public AjaxResult getAppletOrderList(Long parentId, String orderStatus) {
|
||||||
|
if (Objects.isNull(parentId)) {
|
||||||
|
return AjaxResult.error("请选择要查询的用户信息!");
|
||||||
|
}
|
||||||
|
return nursingOrderService.getAppletOrderList(parentId, orderStatus);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -3,9 +3,11 @@ package com.xinelu.applet.mapper.nursingorder;
|
|||||||
|
|
||||||
import com.xinelu.applet.vo.nursingorder.AppletGoodsOrderVO;
|
import com.xinelu.applet.vo.nursingorder.AppletGoodsOrderVO;
|
||||||
import com.xinelu.applet.vo.nursingorder.NursingOrderInfoVO;
|
import com.xinelu.applet.vo.nursingorder.NursingOrderInfoVO;
|
||||||
|
import com.xinelu.applet.vo.nursingorder.PatientOrder;
|
||||||
import com.xinelu.applet.vo.specialdisease.AppointmentOrderDetailsInfoVO;
|
import com.xinelu.applet.vo.specialdisease.AppointmentOrderDetailsInfoVO;
|
||||||
import com.xinelu.common.core.domain.entity.SysDictData;
|
import com.xinelu.common.core.domain.entity.SysDictData;
|
||||||
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
|
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -63,4 +65,22 @@ public interface NursingOrderMapper {
|
|||||||
* @return 护理站信息
|
* @return 护理站信息
|
||||||
*/
|
*/
|
||||||
AppointmentOrderDetailsInfoVO getNurseStationByItemId(Long nurseStationItemId);
|
AppointmentOrderDetailsInfoVO getNurseStationByItemId(Long nurseStationItemId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据openid编号查询对应得订单
|
||||||
|
*
|
||||||
|
* @param patientId openid编号
|
||||||
|
* @param orderStatus 订单状态
|
||||||
|
* @return AjaxResult
|
||||||
|
*/
|
||||||
|
List<PatientOrder> getAppointmentOrderListByParentId(@Param("patientId") Long patientId, @Param("orderStatus") String orderStatus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据openid编号查询对应得订单
|
||||||
|
*
|
||||||
|
* @param patientId openid编号
|
||||||
|
* @param orderStatus 订单状态
|
||||||
|
* @return AjaxResult
|
||||||
|
*/
|
||||||
|
List<PatientOrder> getGoodsOrderAndConsultationOrder(@Param("patientId") Long patientId, @Param("orderStatus") String orderStatus);
|
||||||
}
|
}
|
||||||
@ -55,4 +55,13 @@ public interface INursingOrderService {
|
|||||||
* @return 详情信息
|
* @return 详情信息
|
||||||
*/
|
*/
|
||||||
AjaxResult getAppointmentDetailsInfo(String orderNo);
|
AjaxResult getAppointmentDetailsInfo(String orderNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据openid编号查询对应得订单
|
||||||
|
*
|
||||||
|
* @param parentId openid编号
|
||||||
|
* @param orderStatus 订单状态
|
||||||
|
* @return AjaxResult
|
||||||
|
*/
|
||||||
|
AjaxResult getAppletOrderList(Long parentId, String orderStatus);
|
||||||
}
|
}
|
||||||
@ -5,17 +5,21 @@ import com.xinelu.applet.mapper.nursingorder.NursingOrderMapper;
|
|||||||
import com.xinelu.applet.service.nursingorder.INursingOrderService;
|
import com.xinelu.applet.service.nursingorder.INursingOrderService;
|
||||||
import com.xinelu.applet.vo.nursingorder.AppletGoodsOrderVO;
|
import com.xinelu.applet.vo.nursingorder.AppletGoodsOrderVO;
|
||||||
import com.xinelu.applet.vo.nursingorder.NursingOrderInfoVO;
|
import com.xinelu.applet.vo.nursingorder.NursingOrderInfoVO;
|
||||||
|
import com.xinelu.applet.vo.nursingorder.PatientOrder;
|
||||||
import com.xinelu.applet.vo.specialdisease.AppointmentOrderDetailsInfoVO;
|
import com.xinelu.applet.vo.specialdisease.AppointmentOrderDetailsInfoVO;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.core.domain.entity.SysDictData;
|
import com.xinelu.common.core.domain.entity.SysDictData;
|
||||||
import com.xinelu.common.enums.ConfirmRefundStatusEnum;
|
import com.xinelu.common.enums.ConfirmRefundStatusEnum;
|
||||||
import com.xinelu.common.enums.GooodsOrderStatusEnum;
|
import com.xinelu.common.enums.GooodsOrderStatusEnum;
|
||||||
|
import com.xinelu.common.enums.OrderStatusEnum;
|
||||||
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
|
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@ -31,6 +35,16 @@ public class NursingOrderServiceImpl implements INursingOrderService {
|
|||||||
@Resource
|
@Resource
|
||||||
private NursingOrderMapper nursingOrderMapper;
|
private NursingOrderMapper nursingOrderMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未评价标识
|
||||||
|
*/
|
||||||
|
private final String NOT_EVALUATED = "NOT_EVALUATED";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未评价标识
|
||||||
|
*/
|
||||||
|
private final String EVALUATED = "EVALUATED";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询个人订单列表并分页
|
* 查询个人订单列表并分页
|
||||||
*
|
*
|
||||||
@ -107,4 +121,33 @@ public class NursingOrderServiceImpl implements INursingOrderService {
|
|||||||
}
|
}
|
||||||
return AjaxResult.success(detailsInfoVO);
|
return AjaxResult.success(detailsInfoVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据openid编号查询对应得订单
|
||||||
|
*
|
||||||
|
* @param parentId openid编号
|
||||||
|
* @param orderStatus 订单状态
|
||||||
|
* @return AjaxResult
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AjaxResult getAppletOrderList(Long parentId, String orderStatus) {
|
||||||
|
List<PatientOrder> patientOrders = new ArrayList<>();
|
||||||
|
List<PatientOrder> appletOrderList = new ArrayList<>();
|
||||||
|
List<PatientOrder> goodsOrderAndConsultationOrder = new ArrayList<>();
|
||||||
|
if (NOT_EVALUATED.equals(orderStatus)) {
|
||||||
|
appletOrderList = nursingOrderMapper.getAppointmentOrderListByParentId(parentId, OrderStatusEnum.COMPLETE.getInfo());
|
||||||
|
goodsOrderAndConsultationOrder = nursingOrderMapper.getGoodsOrderAndConsultationOrder(parentId, GooodsOrderStatusEnum.RECEIVED_GOODS.getInfo());
|
||||||
|
}
|
||||||
|
if (EVALUATED.equals(orderStatus)) {
|
||||||
|
appletOrderList = nursingOrderMapper.getAppointmentOrderListByParentId(parentId, OrderStatusEnum.EVALUATED.getInfo());
|
||||||
|
goodsOrderAndConsultationOrder = nursingOrderMapper.getGoodsOrderAndConsultationOrder(parentId, GooodsOrderStatusEnum.EVALUATED.getInfo());
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(appletOrderList)) {
|
||||||
|
patientOrders.addAll(appletOrderList);
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(goodsOrderAndConsultationOrder)) {
|
||||||
|
patientOrders.addAll(goodsOrderAndConsultationOrder);
|
||||||
|
}
|
||||||
|
return AjaxResult.success(patientOrders);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -75,7 +75,6 @@ public class NursingOrderInfoVO extends BaseDomain implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private BigDecimal nurseItemPrice;
|
private BigDecimal nurseItemPrice;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否删除标识,0:否,1:是
|
* 是否删除标识,0:否,1:是
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -0,0 +1,63 @@
|
|||||||
|
package com.xinelu.applet.vo.nursingorder;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description 服务评价
|
||||||
|
* @Author zhangheng
|
||||||
|
* @Date 2022-10-18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class PatientOrder implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 被护理人信息表id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "被护理人信息表id")
|
||||||
|
private Long patientId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单编号
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "订单编号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预约订单状态
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "订单状态")
|
||||||
|
private String orderStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "订单名称")
|
||||||
|
private String orderName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理站护理项目表id
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "护理站护理项目表id")
|
||||||
|
private Long nurseStationItemId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 护理项目图片地址
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "护理项目图片地址")
|
||||||
|
private String pictureUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单类型
|
||||||
|
*/
|
||||||
|
private String orderType;
|
||||||
|
}
|
||||||
@ -338,4 +338,45 @@
|
|||||||
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getAppointmentOrderListByParentId" resultType="com.xinelu.applet.vo.nursingorder.PatientOrder">
|
||||||
|
SELECT
|
||||||
|
ao.patient_id,
|
||||||
|
ao.order_no,
|
||||||
|
ao.order_status,
|
||||||
|
ao.create_time,
|
||||||
|
aod.nurse_item_name orderName,
|
||||||
|
nsi.item_picture_url pictureUrl,
|
||||||
|
'APPOINTMENT_ORDER' AS orderType
|
||||||
|
FROM
|
||||||
|
appointment_order ao
|
||||||
|
LEFT JOIN appointment_order_details aod ON ao.order_no = aod.order_no
|
||||||
|
LEFT JOIN nurse_station_item nsi ON nsi.id = aod.nurse_station_item_id
|
||||||
|
where
|
||||||
|
ao.order_status = #{orderStatus}
|
||||||
|
and ao.patient_id = #{patientId}
|
||||||
|
and ao.del_flag = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getGoodsOrderAndConsultationOrder"
|
||||||
|
resultType="com.xinelu.applet.vo.nursingorder.PatientOrder">
|
||||||
|
SELECT
|
||||||
|
gor.patient_id,
|
||||||
|
gor.order_no,
|
||||||
|
gor.order_status,
|
||||||
|
gor.order_time,
|
||||||
|
gor.order_type,
|
||||||
|
god.goods_name orderName,
|
||||||
|
gad.attribute_piture_url pictureUrl,
|
||||||
|
hpi.person_picture_url
|
||||||
|
FROM
|
||||||
|
goods_order gor
|
||||||
|
LEFT JOIN goods_order_details god ON god.order_no = gor.order_no
|
||||||
|
LEFT JOIN goods_attribute_details gad ON gad.id = god.goods_attribute_details_id
|
||||||
|
LEFT JOIN hospital_person_info hpi ON hpi.id = gor.hospital_person_id
|
||||||
|
where
|
||||||
|
gor.order_status = #{orderStatus}
|
||||||
|
and gor.patient_id = #{patientId}
|
||||||
|
and gor.del_flag = 0
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue
Block a user