| | |
| | | // 计算日期范围 |
| | | Date startDate = DateUtils.addDays(new Date(), -daysAgo); |
| | | String startDateStr = DateUtils.parseDateToStr("yyyy-MM-dd", startDate); |
| | | String endDateStr = DateUtils.parseDateToStr("yyyy-MM-dd", new Date()); |
| | | |
| | | // 从SQL Server查询转运单数据 |
| | | List<Map<String, Object>> transferOrders = legacyTransferSyncMapper.selectTransferOrders(startDateStr); |
| | | List<Map<String, Object>> transferOrders = legacyTransferSyncMapper.selectTransferOrders(startDateStr, endDateStr); |
| | | |
| | | if (transferOrders == null || transferOrders.isEmpty()) { |
| | | log.info("未查询到{}天前的转运单数据", daysAgo); |
| | |
| | | } |
| | | } |
| | | createTaskVo.setPatient(patientInfo); |
| | | //1000公里,提取数字 |
| | | //1000公里,提取数字(支持小数) |
| | | String ServiceOrdTraDistance=MapValueUtils.getStringValue(order, "ServiceOrdTraDistance"); |
| | | if(ServiceOrdTraDistance!=null){ |
| | | ServiceOrdTraDistance=ServiceOrdTraDistance.replaceAll("[^0-9]", ""); |
| | | createTaskVo.setDistance(new BigDecimal(ServiceOrdTraDistance)); |
| | | // 保留数字和小数点,移除其他字符 |
| | | ServiceOrdTraDistance=ServiceOrdTraDistance.replaceAll("[^0-9.]", ""); |
| | | // 处理多个小数点的情况,只保留第一个 |
| | | int firstDotIndex = ServiceOrdTraDistance.indexOf('.'); |
| | | if (firstDotIndex != -1) { |
| | | ServiceOrdTraDistance = ServiceOrdTraDistance.substring(0, firstDotIndex + 1) |
| | | + ServiceOrdTraDistance.substring(firstDotIndex + 1).replace(".", ""); |
| | | } |
| | | if (!ServiceOrdTraDistance.isEmpty() && !ServiceOrdTraDistance.equals(".")) { |
| | | createTaskVo.setTransferDistance(new BigDecimal(ServiceOrdTraDistance)); |
| | | } |
| | | } |
| | | |
| | | |