| | |
| | | List<UserPolicy> list = userPolicyService.list(new LambdaQueryWrapper<UserPolicy>() |
| | | .eq(UserPolicy::getUserId, userAccount.getId()) |
| | | .eq(UserPolicy::getPayStatus,2) |
| | | .eq(UserPolicy::getApprovalStatus,1) |
| | | ); |
| | | return Result.success(list); |
| | | }catch (Exception e){ |
| | |
| | | |
| | | |
| | | /** |
| | | * 保单列表 |
| | | * 支付记录列表 |
| | | */ |
| | | @GetMapping("/PaymentRecordList") |
| | | public TableDataInfo PaymentRecordList(@RequestParam(value = "payOrdeNo",required = false) String payOrdeNo, |
| | | public TableDataInfo PaymentRecordList( @RequestParam(value = "account",required = false) String account, |
| | | @RequestParam(value = "payOrdeNo",required = false) String payOrdeNo, |
| | | @RequestParam(value = "paymentStatus",required = false) Integer paymentStatus) { |
| | | startPage(); |
| | | |
| | | LambdaQueryWrapper<PaymentRecord> wrapper = new LambdaQueryWrapper<>(); |
| | | |
| | | if (StringUtils.isNotEmpty(account)) { |
| | | wrapper.eq(PaymentRecord::getAccount, account); |
| | | } |
| | | // 产品名称模糊查询 |
| | | if (StringUtils.isNotEmpty(payOrdeNo)) { |
| | | wrapper.eq(PaymentRecord::getPayOrdeNo, payOrdeNo); |
| | |
| | | userPolicy.setApprovalStatus(approvalStatus); |
| | | userPolicy.setMessage(message); |
| | | userPolicy.setStartDate(LocalDate.now()); |
| | | userPolicy.setEndDate(expirationTime); |
| | | userPolicy.setEndDate(expirationTime.minusDays(1)); |
| | | userPolicy.setInsuranceBenefitExpiryDate(insuranceBenefitExpiryDate); |
| | | userPolicy.setPolicyStatus(UserPolicy.PolicyStatus.ACTIVE); |
| | | userPolicy.setUpdatedAt(new Date()); |
| | |
| | | throw new RuntimeException("MD5加密失败", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保单列表 |
| | | */ |
| | | @GetMapping("/deleteRecordById") |
| | | public AjaxResult PaymentRecordList(@RequestParam(value = "id",required = false) Integer id) { |
| | | // 查询所有创建时间超过5分钟且状态为待支付的订单 |
| | | PaymentRecord byId = paymentRecordService.getById(id); |
| | | if(ObjectUtil.isEmpty(byId)){ |
| | | return AjaxResult.error("订单不存在!"); |
| | | } |
| | | if(byId.getPaymentStatus() == 2){ |
| | | return AjaxResult.error("订单已支付,禁止删除"); |
| | | } |
| | | UserPolicy userPolicy = userPolicyService.getById(byId.getOrderId()); |
| | | if(ObjectUtil.isEmpty(userPolicy)){ |
| | | return AjaxResult.error("保单不存在!"); |
| | | } |
| | | if(userPolicy.getPayStatus() == 2){ |
| | | return AjaxResult.error("订单已支付,禁止删除"); |
| | | } |
| | | |
| | | paymentRecordService.removeById(byId); |
| | | userPolicyService.removeById(userPolicy); |
| | | return AjaxResult.success("删除成功"); |
| | | } |
| | | |
| | | } |