| | |
| | | # 证书序列号 |
| | | 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 |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | this.wxConfig = wxConfig; |
| | | this.crmClinicService = crmClinicService; |
| | | this.sysUserService = sysUserService; |
| | | this.sysOtherConfigService = sysOtherConfigService; |
| | | } |
| | | |
| | | /** |
| | |
| | | }else { |
| | | sysAppUserVO.setIsClinicUser(0); |
| | | } |
| | | // 查询免费次数 |
| | | TSysOtherConfig sysOtherConfig = sysOtherConfigService.getById(1); |
| | | sysAppUserVO.setAiFreeCount(sysOtherConfig.getAiFreeCount()); |
| | | return R.ok(sysAppUserVO); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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; |
| | | } |
| | |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @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(); |
| | |
| | | secretId: 79c234527fd3b6553679d52be5e29b19 |
| | | v3: |
| | | # 加签串 |
| | | apiKey: V7mKp9qL2Rs4jU6tX8wZ0bC3eF5hN1yD4gA |
| | | apiKey: V7mKp9qL2Rs4jU6tX8wZ0bC3eF5hN1yD |
| | | # 加签证书地址 |
| | | privateKeyPath: /usr/local/project/cert/weixin/apiclient_key.pem |
| | | # 微信支付公钥id |
| | |
| | | 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 |
| | |
| | | "/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() |
| | |
| | | @ApiModelProperty(value = "是否为诊所用户 1=是 0=否") |
| | | private Integer isClinicUser; |
| | | |
| | | @ApiModelProperty(value = "系统免费次数") |
| | | private Integer aiFreeCount; |
| | | |
| | | } |