无关风月
2026-01-13 d98af68f2ea108254ec362ac2497fd619e6dd3eb
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/WxPayController.java
@@ -66,7 +66,7 @@
     */
    @ApiOperation("订单支付")
    @PostMapping("orderPay")
    public R<Map<String, Object>> orderPay(@RequestParam(value = "inspectionId") String inspectionId,@RequestParam(value = "orderType") Integer orderType) {
    public R<Map<String, Object>> orderPay(@RequestParam(value = "inspectionId",required = false) String inspectionId,@RequestParam(value = "orderType") Integer orderType) {
        TSysOtherConfig sysOtherConfig = sysOtherConfigService.getById(1);
        String userId = tokenService.getLoginUserApplet().getUserId();
@@ -138,8 +138,9 @@
                TSysAppUser appUser = sysAppUserService.getById(appUserId);
                if (sysPayRecord.getOrderType()==2){
                    LocalDateTime localDateTime = LocalDateTime.now().plusMonths(1L);
                    localDateTime = localDateTime.withHour(23).withMinute(59).withSecond(59);
                    localDateTime = localDateTime.withHour(23).withMinute(59).withSecond(57);
                    appUser.setVipEndTime(localDateTime);
                    sysAppUserService.updateById(appUser);
                    List<TSysInspection> list = sysInspectionService.lambdaQuery().eq(TSysInspection::getAppUserId, appUserId)
                            .list();
                    if (!list.isEmpty()){
@@ -148,13 +149,13 @@
                        }
                        sysInspectionService.updateBatchById(list);
                    }
                }else {
                    // 处理检测报告为可见
                    TSysInspection sysInspection = sysInspectionService.getById(sysPayRecord.getInspectionId());
                    sysInspection.setIsPay(1);
                    sysInspectionService.updateById(sysInspection);
                }
                sysPayRecordService.updateById(sysPayRecord);
                // 处理检测报告为可见
                TSysInspection sysInspection = sysInspectionService.getById(sysPayRecord.getInspectionId());
                sysInspection.setIsPay(1);
                sysInspectionService.updateById(sysInspection);
                PrintWriter out = response.getWriter();
                out.print("SUCCESS");