xuhy
2026-01-13 a5ae4efedbd5f8829887e8251fffd55c02d00ddc
修改支付信息
8个文件已修改
60 ■■■■■ 已修改文件
ruoyi-admin/src/main/resources/application-test.yml 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TSysAppUserController.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TSysInspectionController.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/WxPayController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-applet/src/main/resources/application-prod.yml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-applet/src/main/resources/application-test.yml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/vo/TSysAppUserVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-test.yml
@@ -235,6 +235,6 @@
      # 证书序列号
      mchSerialNo: 39C7F6152E38A62B5786634D5C1F984FB5A38AD5
      # 支付成功回调地址
      notifyPayUrl: http://221.182.45.100/wx/pay/notify
      notifyPayUrl: http://221.182.45.100:8089/wx/pay/notify
      # 支付退款回调地址
      notifyRefundUrl: http://221.182.45.100/wx/refund/notify
      notifyRefundUrl: http://221.182.45.100:8089/wx/refund/notify
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TSysAppUserController.java
@@ -11,10 +11,7 @@
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.model.TCrmClinic;
import com.ruoyi.system.model.TSysAppUser;
import com.ruoyi.system.model.TSysChronicDisease;
import com.ruoyi.system.model.TSysInspection;
import com.ruoyi.system.model.*;
import com.ruoyi.system.query.TSysAppUserQuery;
import com.ruoyi.system.service.*;
import com.ruoyi.system.utils.util.ObsUploadUtil;
@@ -65,8 +62,9 @@
    private final WeixinProperties wxConfig;
    private final TCrmClinicService crmClinicService;
    private final ISysUserService sysUserService;
    private final TSysOtherConfigService sysOtherConfigService;
    @Autowired
    public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService, TokenService tokenService, RedisCache redisCache, XimaAIUtil ximaAIUtil, RestTemplate restTemplate, FileController fileController, WeixinProperties wxConfig, TCrmClinicService crmClinicService, ISysUserService sysUserService) {
    public TSysAppUserController(TSysAppUserService sysAppUserService, TSysInspectionService sysInspectionService, TSysOrderService sysOrderService, TSysChronicDiseaseService sysChronicDiseaseService, TokenService tokenService, RedisCache redisCache, XimaAIUtil ximaAIUtil, RestTemplate restTemplate, FileController fileController, WeixinProperties wxConfig, TCrmClinicService crmClinicService, ISysUserService sysUserService, TSysOtherConfigService sysOtherConfigService) {
        this.sysAppUserService = sysAppUserService;
        this.sysInspectionService = sysInspectionService;
        this.sysOrderService = sysOrderService;
@@ -79,6 +77,7 @@
        this.wxConfig = wxConfig;
        this.crmClinicService = crmClinicService;
        this.sysUserService = sysUserService;
        this.sysOtherConfigService = sysOtherConfigService;
    }
    /**
@@ -128,6 +127,9 @@
        }else {
            sysAppUserVO.setIsClinicUser(0);
        }
        // 查询免费次数
        TSysOtherConfig sysOtherConfig = sysOtherConfigService.getById(1);
        sysAppUserVO.setAiFreeCount(sysOtherConfig.getAiFreeCount());
        return R.ok(sysAppUserVO);
    }
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TSysInspectionController.java
@@ -10,9 +10,11 @@
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.model.TSysAppUser;
import com.ruoyi.system.model.TSysInspection;
import com.ruoyi.system.model.TSysOtherConfig;
import com.ruoyi.system.query.TSysInspectionQuery;
import com.ruoyi.system.service.TSysAppUserService;
import com.ruoyi.system.service.TSysInspectionService;
import com.ruoyi.system.service.TSysOtherConfigService;
import com.ruoyi.system.utils.util.AIUtil;
import com.ruoyi.system.vo.TSysInspectionVO;
import io.swagger.annotations.Api;
@@ -40,13 +42,15 @@
    private final TSysInspectionService sysInspectionService;
    private final TokenService tokenService;
    private final TSysAppUserService sysAppUserService;
    private final TSysOtherConfigService sysOtherConfigService;
    private final AIUtil aiUtil;
    private final RedisCache redisCache;
    @Autowired
    public TSysInspectionController(TSysInspectionService sysInspectionService, TokenService tokenService, TSysAppUserService sysAppUserService, AIUtil aiUtil, RedisCache redisCache) {
    public TSysInspectionController(TSysInspectionService sysInspectionService, TokenService tokenService, TSysAppUserService sysAppUserService, TSysOtherConfigService sysOtherConfigService, AIUtil aiUtil, RedisCache redisCache) {
        this.sysInspectionService = sysInspectionService;
        this.tokenService = tokenService;
        this.sysAppUserService = sysAppUserService;
        this.sysOtherConfigService = sysOtherConfigService;
        this.aiUtil = aiUtil;
        this.redisCache = redisCache;
    }
@@ -67,7 +71,24 @@
    @ApiOperation(value = "查看用户检测信息管理详情")
    @GetMapping(value = "/getDetailById")
    public R<TSysInspection> getDetailById(@RequestParam String id) {
        return R.ok(sysInspectionService.getById(id));
        // 查询用户信息
        String userId = tokenService.getLoginUserApplet().getUserId();
        TSysAppUser sysAppUser = sysAppUserService.getById(userId);
        // 匹配免费次数
        TSysOtherConfig sysOtherConfig = sysOtherConfigService.getById(1);
        TSysInspection sysInspection = sysInspectionService.getById(id);
        if(sysInspection.getIsPay() == 0 && sysInspection.getInspectionType() == 2){
            // 匹配免费次数
            if(Objects.equals(sysAppUser.getUseAiFreeCount(), sysOtherConfig.getAiFreeCount())){
                return R.fail("您已使用完免费次数");
            }
            // 检测免费次数
            sysAppUser.setUseAiFreeCount(sysAppUser.getUseAiFreeCount() + 1);
            sysAppUserService.updateById(sysAppUser);
            sysInspection.setIsPay(1);
            sysInspectionService.updateById(sysInspection);
        }
        return R.ok(sysInspection);
    }
    /**
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();
ruoyi-applet/src/main/resources/application-prod.yml
@@ -225,7 +225,7 @@
    secretId: 79c234527fd3b6553679d52be5e29b19
    v3:
      # 加签串
      apiKey: V7mKp9qL2Rs4jU6tX8wZ0bC3eF5hN1yD4gA
      apiKey: V7mKp9qL2Rs4jU6tX8wZ0bC3eF5hN1yD
      # 加签证书地址
      privateKeyPath: /usr/local/project/cert/weixin/apiclient_key.pem
      # 微信支付公钥id
ruoyi-applet/src/main/resources/application-test.yml
@@ -213,16 +213,16 @@
    secretId: 79c234527fd3b6553679d52be5e29b19
    v3:
      # 加签串
      apiKey: V7mKp9qL2Rs4jU6tX8wZ0bC3eF5hN1yD4gA
      apiKey: V7mKp9qL2Rs4jU6tX8wZ0bC3eF5hN1yD
      # 加签证书地址
      privateKeyPath: D:/app/cert/weixin/apiclient_key.pem
      privateKeyPath: D:/app/cert/haizhentong/apiclient_key.pem
      # 微信支付公钥id
      publicKeyId: PUB_KEY_ID_0117217579152025091800181718000000
      # 微信支付公钥证书
      publicKeyPath: D:/app/cert/weixin/pub_key.pem
      publicKeyPath: D:/app/cert/haizhentong/pub_key.pem
      # 证书序列号
      mchSerialNo: 39C7F6152E38A62B5786634D5C1F984FB5A38AD5
      # 支付成功回调地址
      notifyPayUrl: http://221.182.45.100/wx/pay/notify
      notifyPayUrl: http://221.182.45.100:8088/wx/pay/notify
      # 支付退款回调地址
      notifyRefundUrl: http://221.182.45.100/wx/refund/notify
      notifyRefundUrl: http://221.182.45.100:8088/wx/refund/notify
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -126,7 +126,7 @@
                        "/t-sys-educational-info/list","/t-sys-educational-info/getDetailById","/t-sys-educational-info/pageList",
                        "/t-sys-live/list","/t-sys-live/getDetailById","/t-sys-live/pageList","/t-sys-qualifications/list",
                        "/open/**","/cos/get/**","/openIdByJsCode","/t-sys-order/**","/openIdByCode","/tRegion/sendTest"
                        ,"/t-sys-qualifications/pageList","/t-sys-qualifications/getDetailById"
                        ,"/t-sys-qualifications/pageList","/t-sys-qualifications/getDetailById","/wx/pay/notify"
                ).permitAll()
                // 静态资源,可匿名访问
                .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
ruoyi-system/src/main/java/com/ruoyi/system/vo/TSysAppUserVO.java
@@ -37,4 +37,7 @@
    @ApiModelProperty(value = "是否为诊所用户 1=是 0=否")
    private Integer isClinicUser;
    @ApiModelProperty(value = "系统免费次数")
    private Integer aiFreeCount;
}