Merge branch 'feature/2025-10-23' into 'master'
Feature/2025 10 23 See merge request !12
Showing
8 changed files
with
78 additions
and
54 deletions
| ... | @@ -21,6 +21,10 @@ public class ClientEndExceptions { | ... | @@ -21,6 +21,10 @@ public class ClientEndExceptions { |
| 21 | * 权限登陆未认证异常 | 21 | * 权限登陆未认证异常 |
| 22 | */ | 22 | */ |
| 23 | public static class AuthenticationFailure extends ClientEndException { | 23 | public static class AuthenticationFailure extends ClientEndException { |
| 24 | + private AuthenticationFailure(ErrorCodeEnum errorCodeEnum) { | ||
| 25 | + super(errorCodeEnum.getCode(), errorCodeEnum.getMessage()); | ||
| 26 | + } | ||
| 27 | + | ||
| 24 | private AuthenticationFailure(String message) { | 28 | private AuthenticationFailure(String message) { |
| 25 | super(ErrorCodeEnum.UNAUTHORIZED.getCode(), message); | 29 | super(ErrorCodeEnum.UNAUTHORIZED.getCode(), message); |
| 26 | } | 30 | } |
| ... | @@ -28,6 +32,10 @@ public class ClientEndExceptions { | ... | @@ -28,6 +32,10 @@ public class ClientEndExceptions { |
| 28 | public synchronized static AuthenticationFailure build(String message) { | 32 | public synchronized static AuthenticationFailure build(String message) { |
| 29 | return new AuthenticationFailure(message); | 33 | return new AuthenticationFailure(message); |
| 30 | } | 34 | } |
| 35 | + | ||
| 36 | + public synchronized static AuthenticationFailure build(ErrorCodeEnum errorCodeEnum) { | ||
| 37 | + return new AuthenticationFailure(errorCodeEnum); | ||
| 38 | + } | ||
| 31 | } | 39 | } |
| 32 | 40 | ||
| 33 | /** | 41 | /** | ... | ... |
| ... | @@ -66,7 +66,9 @@ public enum ErrorCodeEnum implements BaseEnum { | ... | @@ -66,7 +66,9 @@ public enum ErrorCodeEnum implements BaseEnum { |
| 66 | 66 | ||
| 67 | MP_ACCOUNT_ALREADY_DISABLED(406000024, "账号已禁用"), | 67 | MP_ACCOUNT_ALREADY_DISABLED(406000024, "账号已禁用"), |
| 68 | 68 | ||
| 69 | - DINER_MEAL_SUSPENDED(406000025, "当前就餐人处于停餐状态") | 69 | + DINER_MEAL_SUSPENDED(406000025, "当前就餐人处于停餐状态"), |
| 70 | + | ||
| 71 | + ACCOUNT_OR_PASSWORD_IS_INCORRECT(406000026, "账号或密码错误") | ||
| 70 | 72 | ||
| 71 | 73 | ||
| 72 | ; | 74 | ; | ... | ... |
| ... | @@ -71,6 +71,7 @@ public class OrderDbDTO { | ... | @@ -71,6 +71,7 @@ public class OrderDbDTO { |
| 71 | private OrderStatusEnum status; | 71 | private OrderStatusEnum status; |
| 72 | private String keyword; | 72 | private String keyword; |
| 73 | private List<Integer> stallIds; | 73 | private List<Integer> stallIds; |
| 74 | + private String mealTime; | ||
| 74 | } | 75 | } |
| 75 | 76 | ||
| 76 | @Data | 77 | @Data | ... | ... |
| ... | @@ -117,6 +117,7 @@ public class SettlementDTO { | ... | @@ -117,6 +117,7 @@ public class SettlementDTO { |
| 117 | private String skuName; | 117 | private String skuName; |
| 118 | private Integer count; | 118 | private Integer count; |
| 119 | private String avoids; | 119 | private String avoids; |
| 120 | + private String doctors; | ||
| 120 | private String remark; | 121 | private String remark; |
| 121 | } | 122 | } |
| 122 | 123 | ... | ... |
| ... | @@ -91,6 +91,7 @@ import java.io.IOException; | ... | @@ -91,6 +91,7 @@ import java.io.IOException; |
| 91 | import java.time.Duration; | 91 | import java.time.Duration; |
| 92 | import java.time.LocalDate; | 92 | import java.time.LocalDate; |
| 93 | import java.time.LocalDateTime; | 93 | import java.time.LocalDateTime; |
| 94 | +import java.time.LocalTime; | ||
| 94 | import java.time.ZoneOffset; | 95 | import java.time.ZoneOffset; |
| 95 | import java.util.ArrayList; | 96 | import java.util.ArrayList; |
| 96 | import java.util.HashMap; | 97 | import java.util.HashMap; |
| ... | @@ -494,24 +495,32 @@ public class OrderServiceRpcClient { | ... | @@ -494,24 +495,32 @@ public class OrderServiceRpcClient { |
| 494 | .setStatus(queryOrderDto.getStatus()) | 495 | .setStatus(queryOrderDto.getStatus()) |
| 495 | .setEnterpriseId(queryOrderDto.getEnterpriseId()) | 496 | .setEnterpriseId(queryOrderDto.getEnterpriseId()) |
| 496 | .setShouldFilterClientIds(true).addClientIds(queryOrderDto.getClientId()) | 497 | .setShouldFilterClientIds(true).addClientIds(queryOrderDto.getClientId()) |
| 497 | - .setShouldFilterStallIds(true).addAllStallIds(queryOrderDto.getStallIds()) | 498 | + .setShouldFilterStallIds(true).addAllStallIds(queryOrderDto.getStallIds()); |
| 498 | - .build(); | 499 | + if (StringUtils.isNotEmpty(queryOrderDto.getMealTime())) { |
| 499 | - return orderServiceRpcBlockingStub.queryClientCustomerOrdersByCondition(request); | 500 | + LocalDate today = LocalDate.parse(queryOrderDto.getMealTime(), DateUtil.YYYY_MM_DD); |
| 501 | + LocalDateTime todayZero = today.atStartOfDay(); | ||
| 502 | + LocalDateTime todayEnd = today.atTime(LocalTime.MAX); | ||
| 503 | + request.setShouldFilterMealTimeStart(true) | ||
| 504 | + .setMealTimeStart(todayZero.toInstant(ZoneOffset.UTC).toEpochMilli()) | ||
| 505 | + .setShouldFilterMealTimeEnd(true) | ||
| 506 | + .setMealTimeEnd(todayEnd.toInstant(ZoneOffset.UTC).toEpochMilli()); | ||
| 507 | + } | ||
| 508 | + return orderServiceRpcBlockingStub.queryClientCustomerOrdersByCondition(request.build()); | ||
| 500 | } | 509 | } |
| 501 | 510 | ||
| 502 | public QueryClientCustomerOrdersByPaginationRpcResponse queryRefundClientCustomerOrdersByPagination( | 511 | public QueryClientCustomerOrdersByPaginationRpcResponse queryRefundClientCustomerOrdersByPagination( |
| 503 | - QueryRefundOrderByPaginationDto queryOrderDto) { | 512 | + QueryRefundOrderByPaginationDto queryOrderDto) { |
| 504 | final var request = QueryClientCustomerOrdersByPaginationRpcRequest.newBuilder() | 513 | final var request = QueryClientCustomerOrdersByPaginationRpcRequest.newBuilder() |
| 505 | - .setKeyword(queryOrderDto.getKeyword() == null ? "" : queryOrderDto.getKeyword()) | 514 | + .setKeyword(queryOrderDto.getKeyword() == null ? "" : queryOrderDto.getKeyword()) |
| 506 | - .setPageNo(queryOrderDto.getPn()) | 515 | + .setPageNo(queryOrderDto.getPn()) |
| 507 | - .setPageSize(queryOrderDto.getPz()) | 516 | + .setPageSize(queryOrderDto.getPz()) |
| 508 | - .setShouldFilterStatus(false) | 517 | + .setShouldFilterStatus(false) |
| 509 | - .setShouldFilterPayStatus(true) | 518 | + .setShouldFilterPayStatus(true) |
| 510 | - .setPayStatus(PayStatusEnum.REFUND) | 519 | + .setPayStatus(PayStatusEnum.REFUND) |
| 511 | - .setEnterpriseId(queryOrderDto.getEnterpriseId()) | 520 | + .setEnterpriseId(queryOrderDto.getEnterpriseId()) |
| 512 | - .setClientId(queryOrderDto.getClientId()) | 521 | + .setClientId(queryOrderDto.getClientId()) |
| 513 | - .addAllStallIds(queryOrderDto.getStallIds()) | 522 | + .addAllStallIds(queryOrderDto.getStallIds()) |
| 514 | - .build(); | 523 | + .build(); |
| 515 | return orderServiceRpcBlockingStub.queryClientCustomerOrdersByPagination(request); | 524 | return orderServiceRpcBlockingStub.queryClientCustomerOrdersByPagination(request); |
| 516 | } | 525 | } |
| 517 | 526 | ||
| ... | @@ -646,11 +655,11 @@ public class OrderServiceRpcClient { | ... | @@ -646,11 +655,11 @@ public class OrderServiceRpcClient { |
| 646 | } | 655 | } |
| 647 | } | 656 | } |
| 648 | final var orderResponse = orderServiceRpcBlockingStub.createClientCustomerOrder(CreateClientCustomerOrderRpcRequest.newBuilder() | 657 | final var orderResponse = orderServiceRpcBlockingStub.createClientCustomerOrder(CreateClientCustomerOrderRpcRequest.newBuilder() |
| 649 | - .setCreation(creation) | 658 | + .setCreation(creation) |
| 650 | - .setCreationSource(OrderSourceEnum.forNumber(createOrderDto.getCreationSource())) | 659 | + .setCreationSource(OrderSourceEnum.forNumber(createOrderDto.getCreationSource())) |
| 651 | - .setEnterpriseId(createOrderDto.getEnterpriseId()) | 660 | + .setEnterpriseId(createOrderDto.getEnterpriseId()) |
| 652 | - .setCreatedBy(createOrderDto.getCreatedBy()) | 661 | + .setCreatedBy(createOrderDto.getCreatedBy()) |
| 653 | - .build()); | 662 | + .build()); |
| 654 | if (orderResponse.getIsCreated()) { | 663 | if (orderResponse.getIsCreated()) { |
| 655 | // 用餐时间为当天,并且非在线支付餐单,发送消息给客户端 | 664 | // 用餐时间为当天,并且非在线支付餐单,发送消息给客户端 |
| 656 | if (createOrderDto.getMealTime().toLocalDate().equals(LocalDate.now()) && menuById.getResponse().getOrderRuleJson().getModeOfPayment() != ModeOfPaymentEnum.ONLINE) { | 665 | if (createOrderDto.getMealTime().toLocalDate().equals(LocalDate.now()) && menuById.getResponse().getOrderRuleJson().getModeOfPayment() != ModeOfPaymentEnum.ONLINE) { | ... | ... |
| ... | @@ -314,9 +314,12 @@ public class ClientCustomerServiceImpl implements ClientCustomerService { | ... | @@ -314,9 +314,12 @@ public class ClientCustomerServiceImpl implements ClientCustomerService { |
| 314 | @Override | 314 | @Override |
| 315 | public TodayOrderDto getTodayOrderStatisticForHis(String token) { | 315 | public TodayOrderDto getTodayOrderStatisticForHis(String token) { |
| 316 | final var currentCustomers = clientCustomerServiceHttpClient.getCurrentClientCustomer(token, true); | 316 | final var currentCustomers = clientCustomerServiceHttpClient.getCurrentClientCustomer(token, true); |
| 317 | + log.info("currentCustomers size:{}", currentCustomers.size()); | ||
| 317 | final var hisCustomerIds = currentCustomers.stream().map(CurrentClientCustomerDto::getId).distinct().collect(Collectors.toList()); | 318 | final var hisCustomerIds = currentCustomers.stream().map(CurrentClientCustomerDto::getId).distinct().collect(Collectors.toList()); |
| 319 | + log.info("hisCustomerIds size:{} {}", hisCustomerIds.size(), hisCustomerIds); | ||
| 318 | final var currentClientCustomers = clientCustomerServiceRpcClient.getClientCustomersByHISCustomerIds(hisCustomerIds).getResponsesList(); | 320 | final var currentClientCustomers = clientCustomerServiceRpcClient.getClientCustomersByHISCustomerIds(hisCustomerIds).getResponsesList(); |
| 319 | final var customerIds = currentClientCustomers.stream().map(SingleClientCustomerRpcResponse::getId).distinct().collect(Collectors.toList()); | 321 | final var customerIds = currentClientCustomers.stream().map(SingleClientCustomerRpcResponse::getId).distinct().collect(Collectors.toList()); |
| 322 | + log.info("customerIds size:{} {}", customerIds.size(), customerIds); | ||
| 320 | final var mappingHisCustomerIds = currentClientCustomers.stream().map(SingleClientCustomerRpcResponse::getHISCustomerId).collect(Collectors.toList()); | 323 | final var mappingHisCustomerIds = currentClientCustomers.stream().map(SingleClientCustomerRpcResponse::getHISCustomerId).collect(Collectors.toList()); |
| 321 | final var notOrderedHisCustomers = currentCustomers.stream().filter(c -> !mappingHisCustomerIds.contains(c.getId())).collect(Collectors.toList()); | 324 | final var notOrderedHisCustomers = currentCustomers.stream().filter(c -> !mappingHisCustomerIds.contains(c.getId())).collect(Collectors.toList()); |
| 322 | final var operatorLoginInfo = LoginContextHolder.getLoginInfo(); | 325 | final var operatorLoginInfo = LoginContextHolder.getLoginInfo(); |
| ... | @@ -339,6 +342,7 @@ public class ClientCustomerServiceImpl implements ClientCustomerService { | ... | @@ -339,6 +342,7 @@ public class ClientCustomerServiceImpl implements ClientCustomerService { |
| 339 | } | 342 | } |
| 340 | List<Integer> uniqueOrderedCustomerIds = orderedResponseList.stream().map(SingleClientCustomerOrderRpcResponse::getCustomerId).distinct().collect(Collectors.toList()); | 343 | List<Integer> uniqueOrderedCustomerIds = orderedResponseList.stream().map(SingleClientCustomerOrderRpcResponse::getCustomerId).distinct().collect(Collectors.toList()); |
| 341 | List<Integer> notOrderedCustomerIds = customerIds.stream().filter(id -> !uniqueOrderedCustomerIds.contains(id)).collect(Collectors.toList()); | 344 | List<Integer> notOrderedCustomerIds = customerIds.stream().filter(id -> !uniqueOrderedCustomerIds.contains(id)).collect(Collectors.toList()); |
| 345 | + log.info("notOrderedCustomerIds size:{} {}", notOrderedCustomerIds.size(), notOrderedCustomerIds); | ||
| 342 | // 根据customerIds 获取到menuRef列表 | 346 | // 根据customerIds 获取到menuRef列表 |
| 343 | final var menuRefs = menuServiceRpcClient.getClientCustomerMenuRefsByCustomerIds(operatorLoginInfo.getEnterpriseId(), notOrderedCustomerIds).getResponsesList(); | 347 | final var menuRefs = menuServiceRpcClient.getClientCustomerMenuRefsByCustomerIds(operatorLoginInfo.getEnterpriseId(), notOrderedCustomerIds).getResponsesList(); |
| 344 | final var menuIds = menuRefs.stream().map(SingleClientCustomerMenuRefRpcResponse::getMenuId).collect(Collectors.toList()); | 348 | final var menuIds = menuRefs.stream().map(SingleClientCustomerMenuRefRpcResponse::getMenuId).collect(Collectors.toList()); | ... | ... |
| ... | @@ -135,13 +135,13 @@ public class LoginServiceImpl implements LoginService { | ... | @@ -135,13 +135,13 @@ public class LoginServiceImpl implements LoginService { |
| 135 | } else if (loginDto.isShouldLoginWithOperatorPhone()) { | 135 | } else if (loginDto.isShouldLoginWithOperatorPhone()) { |
| 136 | final var operator = operatorServiceRpcClient.getCOperatorByMobileOrEmail(loginDto.getOperatorPhone()); | 136 | final var operator = operatorServiceRpcClient.getCOperatorByMobileOrEmail(loginDto.getOperatorPhone()); |
| 137 | if (operator.getId() == 0) { | 137 | if (operator.getId() == 0) { |
| 138 | - throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.UNAUTHORIZED.name()); | 138 | + throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.ACCOUNT_OR_PASSWORD_IS_INCORRECT); |
| 139 | } | 139 | } |
| 140 | if (!operator.getPassword().equals(sha1Hash(loginDto.getPassword()))) { | 140 | if (!operator.getPassword().equals(sha1Hash(loginDto.getPassword()))) { |
| 141 | - throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.VALIDATE_FAILED.name()); | 141 | + throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.ACCOUNT_OR_PASSWORD_IS_INCORRECT); |
| 142 | } | 142 | } |
| 143 | if (operator.getStatus() != 1) { | 143 | if (operator.getStatus() != 1) { |
| 144 | - throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.VALIDATE_FAILED.name()); | 144 | + throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.ACCOUNT_OR_PASSWORD_IS_INCORRECT); |
| 145 | } | 145 | } |
| 146 | StpUtil.login(operator.getId(), SaLoginModel.create() | 146 | StpUtil.login(operator.getId(), SaLoginModel.create() |
| 147 | .setExtra(CommonConstants.ENTERPRISE_ID, operator.getEnterpriseId()) | 147 | .setExtra(CommonConstants.ENTERPRISE_ID, operator.getEnterpriseId()) |
| ... | @@ -151,13 +151,13 @@ public class LoginServiceImpl implements LoginService { | ... | @@ -151,13 +151,13 @@ public class LoginServiceImpl implements LoginService { |
| 151 | } else { | 151 | } else { |
| 152 | final var operator = wOperatorServiceRpcClient.getWOperatorByEmail(loginDto.getEmail()).getResponse(); | 152 | final var operator = wOperatorServiceRpcClient.getWOperatorByEmail(loginDto.getEmail()).getResponse(); |
| 153 | if (operator.getId() == 0) { | 153 | if (operator.getId() == 0) { |
| 154 | - throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.UNAUTHORIZED.name()); | 154 | + throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.ACCOUNT_OR_PASSWORD_IS_INCORRECT); |
| 155 | } | 155 | } |
| 156 | if (!operator.getPassword().equals(sha1Hash(loginDto.getPassword()))) { | 156 | if (!operator.getPassword().equals(sha1Hash(loginDto.getPassword()))) { |
| 157 | - throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.VALIDATE_FAILED.name()); | 157 | + throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.ACCOUNT_OR_PASSWORD_IS_INCORRECT); |
| 158 | } | 158 | } |
| 159 | if (operator.getStatus() != WOperatorStatus.SHOW) { | 159 | if (operator.getStatus() != WOperatorStatus.SHOW) { |
| 160 | - throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.VALIDATE_FAILED.name()); | 160 | + throw ClientEndExceptions.AuthenticationFailure.build(ErrorCodeEnum.ACCOUNT_OR_PASSWORD_IS_INCORRECT); |
| 161 | } | 161 | } |
| 162 | StpUtil.login(operator.getId(), SaLoginModel.create() | 162 | StpUtil.login(operator.getId(), SaLoginModel.create() |
| 163 | .setExtra(CommonConstants.ENTERPRISE_ID, operator.getEnterpriseId()) | 163 | .setExtra(CommonConstants.ENTERPRISE_ID, operator.getEnterpriseId()) | ... | ... |
| ... | @@ -63,7 +63,6 @@ import java.math.BigDecimal; | ... | @@ -63,7 +63,6 @@ import java.math.BigDecimal; |
| 63 | import java.math.RoundingMode; | 63 | import java.math.RoundingMode; |
| 64 | import java.time.LocalDate; | 64 | import java.time.LocalDate; |
| 65 | import java.time.LocalDateTime; | 65 | import java.time.LocalDateTime; |
| 66 | -import java.time.ZoneId; | ||
| 67 | import java.time.temporal.ChronoUnit; | 66 | import java.time.temporal.ChronoUnit; |
| 68 | import java.util.ArrayList; | 67 | import java.util.ArrayList; |
| 69 | import java.util.Collections; | 68 | import java.util.Collections; |
| ... | @@ -1139,21 +1138,8 @@ public class SettlementServiceImpl implements SettlementService { | ... | @@ -1139,21 +1138,8 @@ public class SettlementServiceImpl implements SettlementService { |
| 1139 | // 查询订单列表 | 1138 | // 查询订单列表 |
| 1140 | final var queryClientCustomerOrdersByConditionRpcResponse = orderServiceRpcClient.queryClientCustomerOrdersByCondition(queryOrderDto); | 1139 | final var queryClientCustomerOrdersByConditionRpcResponse = orderServiceRpcClient.queryClientCustomerOrdersByCondition(queryOrderDto); |
| 1141 | 1140 | ||
| 1142 | - // 今天开始时间的时间戳(毫秒) | 1141 | + |
| 1143 | - final long todayStartTimestamp = LocalDate.now().atStartOfDay() | 1142 | + final var orderList = queryClientCustomerOrdersByConditionRpcResponse.getResponsesList(); |
| 1144 | - .atZone(ZoneId.systemDefault()) | ||
| 1145 | - .toInstant() | ||
| 1146 | - .toEpochMilli(); | ||
| 1147 | - | ||
| 1148 | - final var orderList = queryClientCustomerOrdersByConditionRpcResponse.getResponsesList() | ||
| 1149 | - .stream() | ||
| 1150 | - .filter(e -> { | ||
| 1151 | - boolean payStatusMatch = e.getPayStatus() == PayStatusEnum.SUCCEED|| e.getPayStatus() == PayStatusEnum.PAY_CANCELED; | ||
| 1152 | - // 过滤时间:只查询今天和以后的订单 | ||
| 1153 | - boolean timeMatch = e.getMealTime() >= todayStartTimestamp; | ||
| 1154 | - return payStatusMatch && timeMatch; | ||
| 1155 | - }) | ||
| 1156 | - .toList(); | ||
| 1157 | if (orderList.isEmpty()) { | 1143 | if (orderList.isEmpty()) { |
| 1158 | log.warn("未查询到订单数据,enterpriseId: {}", enterpriseId); | 1144 | log.warn("未查询到订单数据,enterpriseId: {}", enterpriseId); |
| 1159 | return createEmptyExcelBySeparateMeal(); | 1145 | return createEmptyExcelBySeparateMeal(); |
| ... | @@ -1272,6 +1258,10 @@ public class SettlementServiceImpl implements SettlementService { | ... | @@ -1272,6 +1258,10 @@ public class SettlementServiceImpl implements SettlementService { |
| 1272 | List<String> avoidsList = getAvoidsSafely(order); | 1258 | List<String> avoidsList = getAvoidsSafely(order); |
| 1273 | String avoidsStr = String.join(", ", avoidsList); | 1259 | String avoidsStr = String.join(", ", avoidsList); |
| 1274 | 1260 | ||
| 1261 | + // 安全获取医生信息(列表转字符串) | ||
| 1262 | + List<String> doctorsList = getDoctorsSafely(order); | ||
| 1263 | + String doctorsStr = String.join(", ", doctorsList); | ||
| 1264 | + | ||
| 1275 | String remark = order.getRemark(); | 1265 | String remark = order.getRemark(); |
| 1276 | String avoidRemark = order.getAvoidRemark(); | 1266 | String avoidRemark = order.getAvoidRemark(); |
| 1277 | String combinedRemark = ""; | 1267 | String combinedRemark = ""; |
| ... | @@ -1293,6 +1283,7 @@ public class SettlementServiceImpl implements SettlementService { | ... | @@ -1293,6 +1283,7 @@ public class SettlementServiceImpl implements SettlementService { |
| 1293 | .skuName(skuName) | 1283 | .skuName(skuName) |
| 1294 | .count(orderDetail.getCount() != 0 ? orderDetail.getCount() : 0) | 1284 | .count(orderDetail.getCount() != 0 ? orderDetail.getCount() : 0) |
| 1295 | .avoids(avoidsStr) | 1285 | .avoids(avoidsStr) |
| 1286 | + .doctors(doctorsStr) | ||
| 1296 | .remark(combinedRemark) | 1287 | .remark(combinedRemark) |
| 1297 | .build(); | 1288 | .build(); |
| 1298 | mealDetails.add(mealDetail); | 1289 | mealDetails.add(mealDetail); |
| ... | @@ -1369,7 +1360,7 @@ public class SettlementServiceImpl implements SettlementService { | ... | @@ -1369,7 +1360,7 @@ public class SettlementServiceImpl implements SettlementService { |
| 1369 | mainTitleCell.setCellStyle(titleStyle); | 1360 | mainTitleCell.setCellStyle(titleStyle); |
| 1370 | 1361 | ||
| 1371 | // 合并第一行的8列 | 1362 | // 合并第一行的8列 |
| 1372 | - CellRangeAddress titleRegion = new CellRangeAddress(0, 0, 0, 7); | 1363 | + CellRangeAddress titleRegion = new CellRangeAddress(0, 0, 0, 8); |
| 1373 | sheet.addMergedRegion(titleRegion); | 1364 | sheet.addMergedRegion(titleRegion); |
| 1374 | 1365 | ||
| 1375 | // 为合并区域设置边框 | 1366 | // 为合并区域设置边框 |
| ... | @@ -1399,25 +1390,29 @@ public class SettlementServiceImpl implements SettlementService { | ... | @@ -1399,25 +1390,29 @@ public class SettlementServiceImpl implements SettlementService { |
| 1399 | cell2.setCellStyle(headerStyle); | 1390 | cell2.setCellStyle(headerStyle); |
| 1400 | 1391 | ||
| 1401 | Cell cell3 = titleRow.createCell(columnNum++); | 1392 | Cell cell3 = titleRow.createCell(columnNum++); |
| 1402 | - cell3.setCellValue("餐单名称"); | 1393 | + cell3.setCellValue("医嘱信息"); |
| 1403 | cell3.setCellStyle(headerStyle); | 1394 | cell3.setCellStyle(headerStyle); |
| 1404 | 1395 | ||
| 1405 | Cell cell4 = titleRow.createCell(columnNum++); | 1396 | Cell cell4 = titleRow.createCell(columnNum++); |
| 1406 | - cell4.setCellValue("菜品名称"); | 1397 | + cell4.setCellValue("餐单名称"); |
| 1407 | cell4.setCellStyle(headerStyle); | 1398 | cell4.setCellStyle(headerStyle); |
| 1408 | 1399 | ||
| 1409 | Cell cell5 = titleRow.createCell(columnNum++); | 1400 | Cell cell5 = titleRow.createCell(columnNum++); |
| 1410 | - cell5.setCellValue("菜品数量"); | 1401 | + cell5.setCellValue("菜品名称"); |
| 1411 | cell5.setCellStyle(headerStyle); | 1402 | cell5.setCellStyle(headerStyle); |
| 1412 | 1403 | ||
| 1413 | Cell cell6 = titleRow.createCell(columnNum++); | 1404 | Cell cell6 = titleRow.createCell(columnNum++); |
| 1414 | - cell6.setCellValue("忌口信息"); | 1405 | + cell6.setCellValue("菜品数量"); |
| 1415 | cell6.setCellStyle(headerStyle); | 1406 | cell6.setCellStyle(headerStyle); |
| 1416 | 1407 | ||
| 1417 | Cell cell7 = titleRow.createCell(columnNum++); | 1408 | Cell cell7 = titleRow.createCell(columnNum++); |
| 1418 | - cell7.setCellValue("备注"); | 1409 | + cell7.setCellValue("忌口信息"); |
| 1419 | cell7.setCellStyle(headerStyle); | 1410 | cell7.setCellStyle(headerStyle); |
| 1420 | 1411 | ||
| 1412 | + Cell cell8 = titleRow.createCell(columnNum++); | ||
| 1413 | + cell8.setCellValue("备注"); | ||
| 1414 | + cell8.setCellStyle(headerStyle); | ||
| 1415 | + | ||
| 1421 | // 填充数据 | 1416 | // 填充数据 |
| 1422 | final var mealDetails = separateMealDataDto.getMealDetails(); | 1417 | final var mealDetails = separateMealDataDto.getMealDetails(); |
| 1423 | if (mealDetails != null) { | 1418 | if (mealDetails != null) { |
| ... | @@ -1438,29 +1433,33 @@ public class SettlementServiceImpl implements SettlementService { | ... | @@ -1438,29 +1433,33 @@ public class SettlementServiceImpl implements SettlementService { |
| 1438 | dataCell2.setCellStyle(dataStyle); | 1433 | dataCell2.setCellStyle(dataStyle); |
| 1439 | 1434 | ||
| 1440 | Cell dataCell3 = dataRow.createCell(columnNum++); | 1435 | Cell dataCell3 = dataRow.createCell(columnNum++); |
| 1441 | - dataCell3.setCellValue(mealDetail.getMenuName() != null ? mealDetail.getMenuName() : ""); | 1436 | + dataCell3.setCellValue(mealDetail.getDoctors() != null ? mealDetail.getDoctors() : ""); |
| 1442 | dataCell3.setCellStyle(dataStyle); | 1437 | dataCell3.setCellStyle(dataStyle); |
| 1443 | 1438 | ||
| 1444 | Cell dataCell4 = dataRow.createCell(columnNum++); | 1439 | Cell dataCell4 = dataRow.createCell(columnNum++); |
| 1445 | - dataCell4.setCellValue(mealDetail.getSkuName() != null ? mealDetail.getSkuName() : ""); | 1440 | + dataCell4.setCellValue(mealDetail.getMenuName() != null ? mealDetail.getMenuName() : ""); |
| 1446 | dataCell4.setCellStyle(dataStyle); | 1441 | dataCell4.setCellStyle(dataStyle); |
| 1447 | 1442 | ||
| 1448 | Cell dataCell5 = dataRow.createCell(columnNum++); | 1443 | Cell dataCell5 = dataRow.createCell(columnNum++); |
| 1449 | - dataCell5.setCellValue(mealDetail.getCount() != null ? mealDetail.getCount() : 0); | 1444 | + dataCell5.setCellValue(mealDetail.getSkuName() != null ? mealDetail.getSkuName() : ""); |
| 1450 | dataCell5.setCellStyle(dataStyle); | 1445 | dataCell5.setCellStyle(dataStyle); |
| 1451 | 1446 | ||
| 1452 | Cell dataCell6 = dataRow.createCell(columnNum++); | 1447 | Cell dataCell6 = dataRow.createCell(columnNum++); |
| 1453 | - dataCell6.setCellValue(mealDetail.getAvoids() != null ? mealDetail.getAvoids() : ""); | 1448 | + dataCell6.setCellValue(mealDetail.getCount() != null ? mealDetail.getCount() : 0); |
| 1454 | dataCell6.setCellStyle(dataStyle); | 1449 | dataCell6.setCellStyle(dataStyle); |
| 1455 | 1450 | ||
| 1456 | Cell dataCell7 = dataRow.createCell(columnNum++); | 1451 | Cell dataCell7 = dataRow.createCell(columnNum++); |
| 1457 | - dataCell7.setCellValue(mealDetail.getRemark() != null ? mealDetail.getRemark() : ""); | 1452 | + dataCell7.setCellValue(mealDetail.getAvoids() != null ? mealDetail.getAvoids() : ""); |
| 1458 | dataCell7.setCellStyle(dataStyle); | 1453 | dataCell7.setCellStyle(dataStyle); |
| 1454 | + | ||
| 1455 | + Cell dataCell8 = dataRow.createCell(columnNum++); | ||
| 1456 | + dataCell8.setCellValue(mealDetail.getRemark() != null ? mealDetail.getRemark() : ""); | ||
| 1457 | + dataCell8.setCellStyle(dataStyle); | ||
| 1459 | } | 1458 | } |
| 1460 | } | 1459 | } |
| 1461 | 1460 | ||
| 1462 | // 自动调整列宽 | 1461 | // 自动调整列宽 |
| 1463 | - for (int i = 0; i < 8; i++) { | 1462 | + for (int i = 0; i < 9; i++) { |
| 1464 | sheet.autoSizeColumn(i); | 1463 | sheet.autoSizeColumn(i); |
| 1465 | } | 1464 | } |
| 1466 | 1465 | ... | ... |
-
Please register or login to post a comment