|
|
@@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
|
|
|
import cn.iocoder.yudao.module.system.dal.mysql.biz.*;
|
|
|
import cn.iocoder.yudao.module.system.dal.mysql.tenant.TenantMapper;
|
|
|
import cn.iocoder.yudao.module.system.enums.change.BusinessConstants;
|
|
|
+import cn.iocoder.yudao.module.system.service.biz.BuildService;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -22,6 +23,7 @@ import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.time.YearMonth;
|
|
|
import java.time.ZoneId;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
@@ -95,6 +97,10 @@ public class OrderApiImpl implements OrderApi {
|
|
|
private ElderlyInfoMapper elderlyInfoMapper;
|
|
|
@Resource
|
|
|
private ElderlyAskLeaveMapper elderlyAskLeaveMapper;
|
|
|
+ @Resource
|
|
|
+ private ElderlyTempOutMapper elderlyTempOutMapper;
|
|
|
+ @Resource
|
|
|
+ private BuildService buildService;
|
|
|
|
|
|
@Resource
|
|
|
private OutboundRefundConfigMapper outboundRefundConfigMapper;
|
|
|
@@ -274,34 +280,34 @@ public class OrderApiImpl implements OrderApi {
|
|
|
|
|
|
BigDecimal billedStandardAmount = standardAmount;
|
|
|
|
|
|
- if (billYm != null) {
|
|
|
- int daysInBillMonth = billYm.lengthOfMonth();
|
|
|
- LocalDate changeStartDate = expenseItemDO.getChangeStartDate();
|
|
|
- LocalDate changeEndDate = expenseItemDO.getChangeEndDate();
|
|
|
-
|
|
|
- // 费用生效区间与账单月做交集:
|
|
|
- // - 无开始日:视为本月月初
|
|
|
- // - 无结束日:视为本月月末
|
|
|
- LocalDate periodStart = changeStartDate == null ? billStart : changeStartDate;
|
|
|
- LocalDate periodEnd = changeEndDate == null ? billEnd : changeEndDate;
|
|
|
-
|
|
|
- LocalDate overlapStart = periodStart.isAfter(billStart) ? periodStart : billStart;
|
|
|
- LocalDate overlapEnd = periodEnd.isBefore(billEnd) ? periodEnd : billEnd;
|
|
|
-
|
|
|
- if (overlapEnd.isBefore(overlapStart)) {
|
|
|
- // 该费用在账单月无覆盖,跳过
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- long actualDays = ChronoUnit.DAYS.between(overlapStart, overlapEnd) + 1;
|
|
|
- if (daysInBillMonth > 0 && actualDays > 0 && actualDays != daysInBillMonth) {
|
|
|
- BigDecimal dayStandard = standardAmount
|
|
|
- .divide(BigDecimal.valueOf(daysInBillMonth), 8, RoundingMode.HALF_UP);
|
|
|
- billedStandardAmount = dayStandard
|
|
|
- .multiply(BigDecimal.valueOf(actualDays))
|
|
|
- .setScale(2, RoundingMode.HALF_UP);
|
|
|
- }
|
|
|
- }
|
|
|
+// if (billYm != null) {
|
|
|
+// int daysInBillMonth = billYm.lengthOfMonth();
|
|
|
+// LocalDate changeStartDate = expenseItemDO.getChangeStartDate();
|
|
|
+// LocalDate changeEndDate = expenseItemDO.getChangeEndDate();
|
|
|
+//
|
|
|
+// // 费用生效区间与账单月做交集:
|
|
|
+// // - 无开始日:视为本月月初
|
|
|
+// // - 无结束日:视为本月月末
|
|
|
+// LocalDate periodStart = changeStartDate == null ? billStart : changeStartDate;
|
|
|
+// LocalDate periodEnd = changeEndDate == null ? billEnd : changeEndDate;
|
|
|
+//
|
|
|
+// LocalDate overlapStart = periodStart.isAfter(billStart) ? periodStart : billStart;
|
|
|
+// LocalDate overlapEnd = periodEnd.isBefore(billEnd) ? periodEnd : billEnd;
|
|
|
+//
|
|
|
+// if (overlapEnd.isBefore(overlapStart)) {
|
|
|
+// // 该费用在账单月无覆盖,跳过
|
|
|
+// continue;
|
|
|
+// }
|
|
|
+//
|
|
|
+// long actualDays = ChronoUnit.DAYS.between(overlapStart, overlapEnd) + 1;
|
|
|
+// if (daysInBillMonth > 0 && actualDays > 0 && actualDays != daysInBillMonth) {
|
|
|
+// BigDecimal dayStandard = standardAmount
|
|
|
+// .divide(BigDecimal.valueOf(daysInBillMonth), 8, RoundingMode.HALF_UP);
|
|
|
+// billedStandardAmount = dayStandard
|
|
|
+// .multiply(BigDecimal.valueOf(actualDays))
|
|
|
+// .setScale(2, RoundingMode.HALF_UP);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
Integer type = expenseItemDO.getType();
|
|
|
if ((type != null && 1 == type) || expenseItemDO.getItemName().contains("床位费")) {
|
|
|
@@ -314,7 +320,7 @@ public class OrderApiImpl implements OrderApi {
|
|
|
} else if ((type != null && 3 == type) || expenseItemDO.getItemName().contains("餐饮费")) {
|
|
|
dto.setMealAmount(dto.getMealAmount().add(billedStandardAmount));
|
|
|
dto.setMealActualAmount(dto.getMealActualAmount().add(actualAmount));
|
|
|
- } else if ((type != null && 7 == type) || expenseItemDO.getItemName().contains("服务费")) {
|
|
|
+ } else if ((type != null && 7 == type) || expenseItemDO.getItemName().contains("服务费") || expenseItemDO.getItemCategoryName().contains("服务费")) {
|
|
|
dto.setServiceAmount(dto.getServiceAmount().add(billedStandardAmount));
|
|
|
dto.setServiceActualAmount(dto.getServiceActualAmount().add(actualAmount));
|
|
|
}
|
|
|
@@ -408,7 +414,7 @@ public class OrderApiImpl implements OrderApi {
|
|
|
.append("-")
|
|
|
.append(feeLabel)
|
|
|
.append(":")
|
|
|
- .append(adjustAmount.toPlainString())
|
|
|
+ .append(adjustAmount.setScale(2,RoundingMode.HALF_UP).toPlainString())
|
|
|
.append(";");
|
|
|
}
|
|
|
}
|
|
|
@@ -440,7 +446,7 @@ public class OrderApiImpl implements OrderApi {
|
|
|
dto.setExtraServiceAmount(dto.getExtraServiceAmount().add(extraAmount));
|
|
|
}
|
|
|
dto.setAdjustAmount(dto.getAdjustAmount().add(extraAmount));
|
|
|
- dto.setRemark((dto.getRemark() == null ? "" : dto.getRemark()) + dailyExpensesDO.getRemarks() + itemName + ":" + dailyExpensesDO.getAmount());
|
|
|
+ dto.setRemark((dto.getRemark() == null ? "" : dto.getRemark()) + (dailyExpensesDO.getRemarks() == null ? "" : dailyExpensesDO.getRemarks()) + itemName + ":" + dailyExpensesDO.getAmount().setScale(2,RoundingMode.HALF_UP) + ";");
|
|
|
}
|
|
|
|
|
|
/** 判断是否为水电费相关项目 */
|
|
|
@@ -1289,7 +1295,7 @@ public class OrderApiImpl implements OrderApi {
|
|
|
@Override
|
|
|
public List<OrderItemRespVO> getOrderSubListForReport(Integer orgType, Long tenantId, String billingMonth, Integer payStatus) {
|
|
|
List<OrderItemRespVO> listByMonth = getListByMonth(orgType, tenantId, billingMonth, null, payStatus);
|
|
|
- if (CollectionUtils.isEmpty(listByMonth)) {
|
|
|
+ if (StringUtil.isEmptyORNull(billingMonth)) {
|
|
|
return listByMonth;
|
|
|
}
|
|
|
|
|
|
@@ -1297,12 +1303,65 @@ public class OrderApiImpl implements OrderApi {
|
|
|
LocalDate monthStart = YearMonth.parse(billingMonth, formatter).atDay(1);
|
|
|
LocalDate monthEnd = monthStart.withDayOfMonth(monthStart.lengthOfMonth());
|
|
|
|
|
|
- // 批量查询离住记录,避免逐条查询导致性能问题
|
|
|
- Set<Long> elderIds = listByMonth.stream()
|
|
|
- .map(OrderItemRespVO::getId)
|
|
|
- .filter(Objects::nonNull)
|
|
|
+ Set<Long> elderIdsInBill = CollectionUtils.isEmpty(listByMonth) ? Collections.emptySet() :
|
|
|
+ listByMonth.stream().map(OrderItemRespVO::getId).filter(Objects::nonNull).collect(Collectors.toSet());
|
|
|
+
|
|
|
+ Map<Long, List<ElderlyTempOutDO>> tempOutMap = fetchTempOutRecordsByTenant(tenantId, monthStart, monthEnd);
|
|
|
+ if (tempOutMap != null && !tempOutMap.isEmpty() && orgType != null) {
|
|
|
+ Set<Long> affectedElderIds = tempOutMap.keySet();
|
|
|
+ List<ElderlyInfoDO> orgFiltered = elderlyInfoMapper.selectList(
|
|
|
+ new LambdaQueryWrapperX<ElderlyInfoDO>()
|
|
|
+ .in(ElderlyInfoDO::getId, affectedElderIds)
|
|
|
+ .eq(ElderlyInfoDO::getTenantId, tenantId)
|
|
|
+ .eq(ElderlyInfoDO::getOrgType, orgType)
|
|
|
+ );
|
|
|
+ Set<Long> allow = CollectionUtils.isEmpty(orgFiltered) ? Collections.emptySet()
|
|
|
+ : orgFiltered.stream().map(ElderlyInfoDO::getId).filter(Objects::nonNull).collect(Collectors.toSet());
|
|
|
+ if (CollectionUtils.isEmpty(allow)) {
|
|
|
+ tempOutMap = Collections.emptyMap();
|
|
|
+ } else {
|
|
|
+ Map<Long, List<ElderlyTempOutDO>> filtered = new HashMap<>();
|
|
|
+ for (Map.Entry<Long, List<ElderlyTempOutDO>> e : tempOutMap.entrySet()) {
|
|
|
+ if (allow.contains(e.getKey())) {
|
|
|
+ filtered.put(e.getKey(), e.getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tempOutMap = filtered;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Set<Long> wholeMonthLeaveElderIds = tempOutMap.entrySet().stream()
|
|
|
+ .filter(e -> isWholeMonthLeaveByTempOut(e.getValue(), monthStart, monthEnd))
|
|
|
+ .map(Map.Entry::getKey)
|
|
|
.collect(Collectors.toSet());
|
|
|
- Map<Long, List<ElderlyAskLeaveDO>> leaveMap = fetchLeaveRecordsByElders(elderIds, monthStart, monthEnd,tenantId);
|
|
|
+
|
|
|
+ if (CollectionUtils.isNotEmpty(wholeMonthLeaveElderIds)) {
|
|
|
+ Set<Long> missing = wholeMonthLeaveElderIds.stream()
|
|
|
+ .filter(id -> !elderIdsInBill.contains(id))
|
|
|
+ .collect(Collectors.toSet());
|
|
|
+ if (CollectionUtils.isNotEmpty(missing)) {
|
|
|
+ List<ElderlyInfoDO> elderlyInfos = elderlyInfoMapper.selectBatchIds(missing);
|
|
|
+ if (CollectionUtils.isNotEmpty(elderlyInfos)) {
|
|
|
+ List<OrderItemRespVO> missingVos = new ArrayList<>();
|
|
|
+ for (ElderlyInfoDO info : elderlyInfos) {
|
|
|
+ if (info == null || info.getId() == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ missingVos.add(buildWholeMonthLeaveWithoutBillVO(info, billingMonth));
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isNotEmpty(missingVos)) {
|
|
|
+ if (listByMonth == null) {
|
|
|
+ listByMonth = new ArrayList<>();
|
|
|
+ }
|
|
|
+ listByMonth.addAll(missingVos);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (CollectionUtils.isEmpty(listByMonth)) {
|
|
|
+ return listByMonth;
|
|
|
+ }
|
|
|
|
|
|
for (OrderItemRespVO vo : listByMonth) {
|
|
|
Long elderId = vo.getId();
|
|
|
@@ -1310,27 +1369,25 @@ public class OrderApiImpl implements OrderApi {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- List<ElderlyAskLeaveDO> leaveList = leaveMap.get(elderId);
|
|
|
- if (CollectionUtils.isEmpty(leaveList)) {
|
|
|
+ List<ElderlyTempOutDO> outList = tempOutMap.get(elderId);
|
|
|
+ if (CollectionUtils.isEmpty(outList)) {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
// 1) 整月离住,分组为“离住”
|
|
|
- boolean whole = leaveList.stream().anyMatch(r -> isWholeMonthOutbound(r, monthStart, monthEnd))
|
|
|
- || isWholeMonthByMultipleOutbounds(leaveList, monthStart, monthEnd);
|
|
|
+ boolean whole = isWholeMonthLeaveByTempOut(outList, monthStart, monthEnd);
|
|
|
if (whole) {
|
|
|
vo.setInStatus("离住");
|
|
|
+ keepMonthlyFeesOnly(vo);
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
boolean hasEndInMonth = false;
|
|
|
boolean hasStartInMonthAndNotEnd = false;
|
|
|
|
|
|
- for (ElderlyAskLeaveDO leave : leaveList) {
|
|
|
- LocalDate outDate = leave.getOutDate() == null ? null :
|
|
|
- leave.getOutDate().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDate();
|
|
|
- LocalDate backDate = leave.getUpdateDate() == null ? null :
|
|
|
- leave.getUpdateDate().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDate();
|
|
|
+ for (ElderlyTempOutDO out : outList) {
|
|
|
+ LocalDate outDate = out.getOutTime() == null ? null : out.getOutTime().toLocalDate();
|
|
|
+ LocalDate backDate = out.getComeTime() == null ? null : out.getComeTime().toLocalDate();
|
|
|
|
|
|
if (backDate != null && !backDate.isBefore(monthStart) && !backDate.isAfter(monthEnd)) {
|
|
|
hasEndInMonth = true;
|
|
|
@@ -1362,6 +1419,156 @@ public class OrderApiImpl implements OrderApi {
|
|
|
return listByMonth;
|
|
|
}
|
|
|
|
|
|
+ private Map<Long, List<ElderlyTempOutDO>> fetchTempOutRecordsByTenant(Long tenantId,
|
|
|
+ LocalDate monthStart,
|
|
|
+ LocalDate monthEnd) {
|
|
|
+ if (tenantId == null) {
|
|
|
+ return Collections.emptyMap();
|
|
|
+ }
|
|
|
+ LocalDateTime monthStartDt = monthStart.atStartOfDay();
|
|
|
+ LocalDateTime monthEndDt = monthEnd.atTime(23, 59, 59);
|
|
|
+
|
|
|
+ List<ElderlyTempOutDO> records = elderlyTempOutMapper.selectList(
|
|
|
+ new LambdaQueryWrapperX<ElderlyTempOutDO>()
|
|
|
+ .eq(ElderlyTempOutDO::getTenantId, tenantId)
|
|
|
+ .le(ElderlyTempOutDO::getOutTime, monthEndDt)
|
|
|
+ .and(w -> w.ge(ElderlyTempOutDO::getComeTime, monthStartDt).or().isNull(ElderlyTempOutDO::getComeTime))
|
|
|
+ .orderByAsc(ElderlyTempOutDO::getElderId, ElderlyTempOutDO::getOutTime)
|
|
|
+ );
|
|
|
+ if (CollectionUtils.isEmpty(records)) {
|
|
|
+ return Collections.emptyMap();
|
|
|
+ }
|
|
|
+ return records.stream().collect(Collectors.groupingBy(ElderlyTempOutDO::getElderId));
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean isWholeMonthLeaveByTempOut(List<ElderlyTempOutDO> outList, LocalDate monthStart, LocalDate monthEnd) {
|
|
|
+ if (CollectionUtils.isEmpty(outList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ for (ElderlyTempOutDO out : outList) {
|
|
|
+ if (out == null || out.getOutTime() == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ LocalDate outDate = out.getOutTime().toLocalDate();
|
|
|
+ LocalDate comeDate = out.getComeTime() == null ? null : out.getComeTime().toLocalDate();
|
|
|
+ if (!outDate.isAfter(monthStart) && (comeDate == null || comeDate.isAfter(monthEnd))) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ private OrderItemRespVO buildWholeMonthLeaveWithoutBillVO(ElderlyInfoDO info, String billingMonth) {
|
|
|
+ OrderItemRespVO vo = new OrderItemRespVO();
|
|
|
+ vo.setId(info.getId());
|
|
|
+ vo.setElderName(info.getElderName() == null ? "" : info.getElderName());
|
|
|
+ vo.setBillingMonth(billingMonth);
|
|
|
+ vo.setElderSex(toSexStr(info.getElderSex()));
|
|
|
+ vo.setElderAge(info.getElderAge() == null ? 0 : info.getElderAge());
|
|
|
+ vo.setBuildName(info.getBuildName() == null ? "" : info.getBuildName());
|
|
|
+ String fullBedName = buildService == null ? null : buildService.getFullBedName(info.getId());
|
|
|
+ vo.setBedName(StringUtil.isEmptyORNull(fullBedName) ? (info.getBedName() == null ? "" : info.getBedName()) : fullBedName);
|
|
|
+ vo.setNurseLevelName(info.getNurseLevelName() == null ? "" : info.getNurseLevelName());
|
|
|
+ vo.setCareType(toCareTypeStr(info.getCareType()));
|
|
|
+ vo.setAddress(info.getAddress() == null ? "" : info.getAddress());
|
|
|
+ vo.setTenantId(info.getTenantId() == null ? null : info.getTenantId().intValue());
|
|
|
+ vo.setOrgType(info.getOrgType());
|
|
|
+
|
|
|
+ vo.setInStatus("离住");
|
|
|
+ vo.setPayStatus("");
|
|
|
+ vo.setRemark("");
|
|
|
+
|
|
|
+ vo.setBedAmount(BigDecimal.ZERO);
|
|
|
+ vo.setMealAmount(BigDecimal.ZERO);
|
|
|
+ vo.setNurseAmount(BigDecimal.ZERO);
|
|
|
+ vo.setServiceAmount(BigDecimal.ZERO);
|
|
|
+ vo.setTotalAmount(BigDecimal.ZERO);
|
|
|
+ vo.setAdjustAmount(BigDecimal.ZERO);
|
|
|
+
|
|
|
+ vo.setBedActualAmount(BigDecimal.ZERO);
|
|
|
+ vo.setMealActualAmount(BigDecimal.ZERO);
|
|
|
+ vo.setNurseActualAmount(BigDecimal.ZERO);
|
|
|
+ vo.setServiceActualAmount(BigDecimal.ZERO);
|
|
|
+ vo.setTotalActualAmount(BigDecimal.ZERO);
|
|
|
+ vo.setExtraServiceAmount(BigDecimal.ZERO);
|
|
|
+ vo.setActualProportion("0%");
|
|
|
+
|
|
|
+ List<ExpenseItemDO> monthlyItems = itemMapper.generateMonthlyBill(info.getId(), billingMonth, 0);
|
|
|
+ if (CollectionUtils.isEmpty(monthlyItems)) {
|
|
|
+ monthlyItems = itemMapper.generateMonthlyBill(info.getId(), billingMonth, 1);
|
|
|
+ }
|
|
|
+ if (CollectionUtils.isNotEmpty(monthlyItems)) {
|
|
|
+ for (ExpenseItemDO item : monthlyItems) {
|
|
|
+ if (item == null) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ Integer type = item.getType();
|
|
|
+ BigDecimal amt = item.getTotalAmount() == null ? BigDecimal.ZERO : item.getTotalAmount();
|
|
|
+ if (type != null && type == 1) {
|
|
|
+ vo.setBedAmount(vo.getBedAmount().add(amt));
|
|
|
+ vo.setBedActualAmount(vo.getBedActualAmount().add(amt));
|
|
|
+ } else if (type != null && type == 2) {
|
|
|
+ vo.setNurseAmount(vo.getNurseAmount().add(amt));
|
|
|
+ vo.setNurseActualAmount(vo.getNurseActualAmount().add(amt));
|
|
|
+ } else if (type != null && type == 3) {
|
|
|
+ vo.setMealAmount(vo.getMealAmount().add(amt));
|
|
|
+ vo.setMealActualAmount(vo.getMealActualAmount().add(amt));
|
|
|
+ } else if (type != null && type == 7) {
|
|
|
+ vo.setServiceAmount(vo.getServiceAmount().add(amt));
|
|
|
+ vo.setServiceActualAmount(vo.getServiceActualAmount().add(amt));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ BigDecimal standardTotal = vo.getBedAmount().add(vo.getMealAmount()).add(vo.getNurseAmount()).add(vo.getServiceAmount());
|
|
|
+ vo.setTotalAmount(standardTotal);
|
|
|
+ vo.setTotalActualAmount(standardTotal);
|
|
|
+ vo.setActualProportion(standardTotal.compareTo(BigDecimal.ZERO) > 0 ? "100%" : "0%");
|
|
|
+ }
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void keepMonthlyFeesOnly(OrderItemRespVO vo) {
|
|
|
+ if (vo == null) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ vo.setAdjustAmount(BigDecimal.ZERO);
|
|
|
+ vo.setExtraServiceAmount(BigDecimal.ZERO);
|
|
|
+ BigDecimal total = nz(vo.getBedAmount()).add(nz(vo.getMealAmount())).add(nz(vo.getNurseAmount())).add(nz(vo.getServiceAmount()));
|
|
|
+ vo.setTotalAmount(total);
|
|
|
+ BigDecimal actualTotal = nz(vo.getBedActualAmount()).add(nz(vo.getMealActualAmount())).add(nz(vo.getNurseActualAmount())).add(nz(vo.getServiceActualAmount()));
|
|
|
+ vo.setTotalActualAmount(actualTotal);
|
|
|
+ if (total.compareTo(BigDecimal.ZERO) > 0) {
|
|
|
+ BigDecimal p = actualTotal.divide(total, 4, RoundingMode.HALF_UP)
|
|
|
+ .multiply(new BigDecimal("100"))
|
|
|
+ .setScale(2, RoundingMode.HALF_UP);
|
|
|
+ vo.setActualProportion(p.toPlainString() + "%");
|
|
|
+ } else {
|
|
|
+ vo.setActualProportion("0%");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private String toSexStr(Integer elderSex) {
|
|
|
+ if (elderSex == null) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ return elderSex == 1 ? "男" : "女";
|
|
|
+ }
|
|
|
+
|
|
|
+ private String toCareTypeStr(Integer careType) {
|
|
|
+ if (careType == null) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ switch (careType) {
|
|
|
+ case 1:
|
|
|
+ return "供养";
|
|
|
+ case 2:
|
|
|
+ return "寄养";
|
|
|
+ case 3:
|
|
|
+ return "托养";
|
|
|
+ default:
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 批量查询指定长者在某月的“离住”外出记录(有交集的记录),并按 elderId 分组
|
|
|
*/
|