| | |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | | |
| | | import com.ruoyi.common.enums.DataSourceType; |
| | | import com.ruoyi.system.domain.DictionaryCondition; |
| | | import com.ruoyi.system.domain.DispatchOrd; |
| | | import com.ruoyi.system.domain.TbOrders; |
| | | import com.ruoyi.system.domain.*; |
| | | import com.ruoyi.system.service.IDispatchOrdService; |
| | | import com.ruoyi.system.service.IPayInfoService; |
| | | import com.ruoyi.system.service.ITbOrdersService; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.system.domain.ServiceOrder; |
| | | import com.ruoyi.system.service.IServiceOrderService; |
| | | |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/system/order") |
| | | //@DataSource(DataSourceType.SQLSERVER) |
| | | public class ServiceOrderController extends BaseController { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(ServiceOrderController.class); |
| | | @Autowired |
| | | private IServiceOrderService serviceOrderService; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private IDispatchOrdService dispatchOrdService; |
| | | |
| | | @Autowired |
| | | private IPayInfoService payInfoService; |
| | | |
| | | /** |
| | | * 获取服务订单列表 |
| | |
| | | * 根据服务订单编号获取详细信息 |
| | | */ |
| | | |
| | | @Anonymous |
| | | @Anonymous(needSign = true) |
| | | @GetMapping(value = "/{serviceOrdId}") |
| | | public AjaxResult getInfo(@PathVariable Long serviceOrdId) { |
| | | TbOrders orderDetail = tbOrdersService.selectTbOrdersByOrderID(serviceOrdId); |
| | | |
| | | if(orderDetail==null){ |
| | | return AjaxResult.error("订单不存在"); |
| | | } |
| | | |
| | | //查询服务单 |
| | | ServiceOrder mingServiceOrder = serviceOrderService.selectServiceOrderById(Long.valueOf(orderDetail.getServiceOrdID())); |
| | | |
| | | DispatchOrd dispatchOrd = dispatchOrdService.selectDispatchOrdByServiceOrdIDDt(mingServiceOrder.getServiceOrdId().toString()); |
| | | |
| | | |
| | | Map<String, Object> data = new HashMap<>(); |
| | | |
| | | // 构建订单基本信息 |
| | |
| | | medicalInfo.put("useVentilator", useVentilator); |
| | | |
| | | |
| | | List<PayInfo> payInfoList = new ArrayList<>(); |
| | | if(serviceOrdId==88801) |
| | | { |
| | | //测试数据 |
| | | payInfoList = payInfoService.selectPayInfoByServiceOrdIDDt("1016302788");//测试使用 |
| | | } |
| | | else{ |
| | | payInfoList = payInfoService.selectPayInfoByServiceOrdIDDt(orderDetail.getServiceOrdID()); //正式使用 |
| | | } |
| | | |
| | | |
| | | //其他信息 |
| | | Map<String, Object> otherInfo = new HashMap<>(); |
| | | //评价 |
| | | otherInfo.put("serviceOrdVisit", Objects.toString(mingServiceOrder.getServiceOrdVisit(), "-")); |
| | | |
| | | //知情同意书 |
| | | List<String> imageUrls = dispatchOrdService.selectImageUrlsByDOrdIDDt(orderDetail.getServiceOrdID()); //正式使用 |
| | | otherInfo.put("imageUrls", imageUrls); |
| | | log.info("【监测】知情同意书:{}", imageUrls); |
| | | |
| | | //发票获取 |
| | | Map<String, Object> invoiceInfo = new HashMap<>(); |
| | | |
| | | if(serviceOrdId==88801) |
| | | { |
| | | //测试数据 |
| | | invoiceInfo = payInfoService.selectLatestInvoiceInfo("1016302788"); |
| | | } |
| | | else{ |
| | | invoiceInfo = payInfoService.selectLatestInvoiceInfo(orderDetail.getServiceOrdID()); //正式使用 |
| | | } |
| | | |
| | | String invoiceStatus = ""; |
| | | if (invoiceInfo != null && invoiceInfo.get("AuditStatus") != null) { |
| | | switch (String.valueOf(invoiceInfo.get("AuditStatus"))) { |
| | | case "0": |
| | | invoiceStatus = "未处理"; |
| | | break; |
| | | case "1": |
| | | invoiceStatus = "延后处理"; |
| | | break; |
| | | case "3": |
| | | invoiceStatus = "已开票"; |
| | | break; |
| | | case "4": |
| | | invoiceStatus = "取消申请"; |
| | | break; |
| | | } |
| | | otherInfo.put("invoiceStatus",invoiceInfo.get("InvoiceMakeout")+"-"+invoiceStatus); |
| | | } |
| | | |
| | | |
| | | |
| | | data.put("orderInfo", orderInfo); |
| | | data.put("patientInfo", patientInfo); |
| | | data.put("serviceInfo", serviceInfo); |
| | | data.put("medicalInfo", medicalInfo); // 暂时为空 |
| | | data.put("dispatchInfo", dispatchInfo); // 更新为包含人员信息的dispatchInfo |
| | | data.put("paymentInfo", new ArrayList<>()); // 暂时为空 |
| | | data.put("operationInfo", new ArrayList<>()); // 暂时为空 |
| | | data.put("paymentInfo", payInfoList); // 暂时为空 |
| | | data.put("otherInfo", otherInfo); |
| | | |
| | | |
| | | return AjaxResult.success(data); |
| | | } |