You've already forked FrameTour-BE
feat(voucher): 电子凭证打印增加预约功能
- 在 AppClaimController 中添加了对 morphId 的非空判断,只有在 morphId 存在时才进行打印操作 - 在 VoucherPrintServiceImpl 中增加了景点配置的检查,包括预约功能是否启用和指定的经纪人 ID
This commit is contained in:
@@ -42,8 +42,10 @@ public class AppClaimController {
|
||||
VoucherPrintResp voucherPrintResp = voucherPrintService.queryPrintedVoucher(face.getId());
|
||||
if (voucherPrintResp == null) {
|
||||
// 打印
|
||||
if (req.getMorphId() != null) {
|
||||
voucherPrintResp = voucherPrintService.printVoucherTicket(new VoucherPrintReq(face.getId(), req.getMorphId(), face.getScenicId()));
|
||||
}
|
||||
}
|
||||
if (voucherPrintResp != null) {
|
||||
claimResp.setHasCoupon(false);
|
||||
claimResp.setHasPrint(true);
|
||||
@@ -57,8 +59,10 @@ public class AppClaimController {
|
||||
VoucherPrintResp voucherPrintResp = voucherPrintService.queryPrintedVoucher(face.getId());
|
||||
if (voucherPrintResp == null) {
|
||||
// 打印
|
||||
if (req.getMorphId() != null) {
|
||||
voucherPrintResp = voucherPrintService.printBookingTicket(new VoucherPrintReq(face.getId(), req.getMorphId(), face.getScenicId()));
|
||||
}
|
||||
}
|
||||
if (voucherPrintResp != null) {
|
||||
claimResp.setHasCoupon(false);
|
||||
claimResp.setHasPrint(true);
|
||||
|
@@ -16,6 +16,7 @@ import com.ycwl.basic.pricing.service.VoucherPrintService;
|
||||
import com.ycwl.basic.printer.ticket.FeiETicketPrinter;
|
||||
import com.ycwl.basic.repository.FaceRepository;
|
||||
import com.ycwl.basic.repository.ScenicRepository;
|
||||
import com.ycwl.basic.util.ScenicConfigManager;
|
||||
import com.ycwl.basic.utils.WxMpUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
@@ -183,6 +184,17 @@ public class VoucherPrintServiceImpl implements VoucherPrintService {
|
||||
}
|
||||
request.setScenicId(face.getScenicId());
|
||||
|
||||
ScenicConfigManager config = scenicRepository.getScenicConfigManager(face.getScenicId());
|
||||
if (!Boolean.TRUE.equals(config.getBoolean("booking_enable"))) {
|
||||
return null;
|
||||
}
|
||||
Long brokerId = config.getLong("booking_broker_id");
|
||||
if (brokerId != null) {
|
||||
if (!request.getBrokerId().equals(brokerId)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Long currentUserId = Long.valueOf(BaseContextHandler.getUserId());
|
||||
|
||||
// 验证faceId是否属于当前用户
|
||||
|
Reference in New Issue
Block a user