|
|
@@ -38,6 +38,7 @@ import com.ruoyi.info.order.enums.CancellationMethod;
|
|
|
import com.ruoyi.info.order.enums.OrderStatus;
|
|
|
import com.ruoyi.info.order.exception.OrderExceptionEnum;
|
|
|
import com.ruoyi.info.order.mapper.OrderMapper;
|
|
|
+import com.ruoyi.info.order.service.IOrderRefundService;
|
|
|
import com.ruoyi.info.order.service.IOrderReviewsService;
|
|
|
import com.ruoyi.info.order.service.IOrderService;
|
|
|
import com.ruoyi.info.order.service.IOrderWorkerChangeRecordService;
|
|
|
@@ -52,12 +53,13 @@ import com.ruoyi.system.service.ISysSequenceService;
|
|
|
import com.ruoyi.user.domain.User;
|
|
|
import com.ruoyi.user.service.IUserService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.Collection;
|
|
|
-import java.util.Collections;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -84,6 +86,9 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
private final IOrderWorkerChangeRecordService orderWorkerChangeRecordService;
|
|
|
private final IManagementTeacherService managementTeacherService;
|
|
|
private final IOrderReviewsService orderReviewsService;
|
|
|
+ @Lazy
|
|
|
+ @Resource
|
|
|
+ private IOrderRefundService orderRefundService;
|
|
|
|
|
|
/**
|
|
|
* 查询订单分页
|
|
|
@@ -180,6 +185,7 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
OrderReviewsVo orderReviewsVo = orderReviewsService.queryByOrderId(vo.getId());
|
|
|
vo.setOrderReviews(orderReviewsVo);
|
|
|
}
|
|
|
+ vo.setHasRefund(orderRefundService.hasRefund(vo.getId()));
|
|
|
return vo;
|
|
|
}
|
|
|
|
|
|
@@ -457,34 +463,39 @@ public class OrderServiceImpl implements IOrderService {
|
|
|
return baseMapper.selectOrderWorkerSum();
|
|
|
}
|
|
|
|
|
|
- private List<OrderVo> convertAllList(List<OrderVo> list, boolean queryPatient) {
|
|
|
- return list.stream().map(o -> {
|
|
|
- HospitalVo hospitalVo = JSONObject.parseObject(o.getHospitalInfo(), HospitalVo.class);
|
|
|
- if (ObjectUtil.isNotNull(hospitalVo)) {
|
|
|
- o.setHospitalName(hospitalVo.getName());
|
|
|
- o.setHospitalAddress(hospitalVo.getAddress());
|
|
|
- }
|
|
|
- //科室
|
|
|
- HospitalDepartmentVo hospitalDepartmentVo = JSONObject.parseObject(o.getHospitalDepartmentInfo(), HospitalDepartmentVo.class);
|
|
|
- if (ObjectUtil.isNotNull(hospitalDepartmentVo)) {
|
|
|
- o.setHospitalDepartmentName(hospitalDepartmentVo.getName());
|
|
|
- }
|
|
|
- //服务
|
|
|
- ServiceProductVo serviceProductVo = JSONObject.parseObject(o.getServiceInfo(), ServiceProductVo.class);
|
|
|
- if (ObjectUtil.isNotNull(serviceProductVo)) {
|
|
|
- o.setServiceName(serviceProductVo.getName());
|
|
|
- }
|
|
|
- if(queryPatient) {
|
|
|
- PatientVo patientVo = JSONObject.parseObject(o.getPatientInfo(), PatientVo.class);
|
|
|
- if (ObjectUtil.isNotNull(patientVo)) {
|
|
|
- o.setPatientName(patientVo.getName());
|
|
|
- o.setPatientMobile(patientVo.getMobile());
|
|
|
- o.setPatientGender(patientVo.getGender());
|
|
|
- o.setPatientAge(patientVo.getAge());
|
|
|
- o.setPatientRelationship(patientVo.getRelationship());
|
|
|
- }
|
|
|
+ @Override
|
|
|
+ public OrderVo convertAllVo(OrderVo vo, boolean queryPatient) {
|
|
|
+ HospitalVo hospitalVo = JSONObject.parseObject(vo.getHospitalInfo(), HospitalVo.class);
|
|
|
+ if (ObjectUtil.isNotNull(hospitalVo)) {
|
|
|
+ vo.setHospitalName(hospitalVo.getName());
|
|
|
+ vo.setHospitalAddress(hospitalVo.getAddress());
|
|
|
+ }
|
|
|
+ //科室
|
|
|
+ HospitalDepartmentVo hospitalDepartmentVo = JSONObject.parseObject(vo.getHospitalDepartmentInfo(), HospitalDepartmentVo.class);
|
|
|
+ if (ObjectUtil.isNotNull(hospitalDepartmentVo)) {
|
|
|
+ vo.setHospitalDepartmentName(hospitalDepartmentVo.getName());
|
|
|
+ }
|
|
|
+ //服务
|
|
|
+ ServiceProductVo serviceProductVo = JSONObject.parseObject(vo.getServiceInfo(), ServiceProductVo.class);
|
|
|
+ if (ObjectUtil.isNotNull(serviceProductVo)) {
|
|
|
+ vo.setServiceName(serviceProductVo.getName());
|
|
|
+ }
|
|
|
+ if(queryPatient) {
|
|
|
+ PatientVo patientVo = JSONObject.parseObject(vo.getPatientInfo(), PatientVo.class);
|
|
|
+ if (ObjectUtil.isNotNull(patientVo)) {
|
|
|
+ vo.setPatientName(patientVo.getName());
|
|
|
+ vo.setPatientMobile(patientVo.getMobile());
|
|
|
+ vo.setPatientGender(patientVo.getGender());
|
|
|
+ vo.setPatientAge(patientVo.getAge());
|
|
|
+ vo.setPatientRelationship(patientVo.getRelationship());
|
|
|
}
|
|
|
- return o;
|
|
|
- }).collect(Collectors.toList());
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<OrderVo> convertAllList(List<OrderVo> list, boolean queryPatient) {
|
|
|
+ return list.stream().map(o -> convertAllVo(o, queryPatient)).collect(Collectors.toList());
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|