Kaynağa Gözat

储值支付

yys 3 hafta önce
ebeveyn
işleme
9ca7a7de81

+ 95 - 0
fs-admin/src/main/java/com/fs/company/controller/RechargeRecordController.java

@@ -0,0 +1,95 @@
+package com.fs.company.controller;
+
+import cn.hutool.core.util.ObjectUtil;
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.domain.R;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.company.domain.Company;
+import com.fs.company.domain.RechargeRecord;
+import com.fs.company.service.ICompanyService;
+import com.fs.company.service.IRechargeRecordService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * 储值支付记录Controller
+ *
+ * @author ruoyi
+ * @date 2026-03-17
+ */
+@RestController
+@RequestMapping("/company/rechargeRecord")
+public class RechargeRecordController extends BaseController
+{
+    @Autowired
+    private IRechargeRecordService rechargeRecordService;
+
+    @Autowired
+    private ICompanyService companyService;
+
+    /**
+     * 查询储值支付记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:rechargeRecord:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(RechargeRecord rechargeRecord)
+    {
+        startPage();
+        List<RechargeRecord> list = rechargeRecordService.selectRechargeRecordList(rechargeRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出储值支付记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('company:rechargeRecord:export')")
+    @Log(title = "储值支付记录", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public AjaxResult export(@RequestBody RechargeRecord rechargeRecord) throws IOException {
+        List<RechargeRecord> list = rechargeRecordService.selectRechargeRecordList(rechargeRecord);
+        ExcelUtil<RechargeRecord> util = new ExcelUtil<RechargeRecord>(RechargeRecord.class);
+        return util.exportExcel(list, "储值支付记录数据");
+    }
+
+    /**
+     * 获取储值支付记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('company:rechargeRecord:query')")
+    @GetMapping(value = "/{id}")
+    public R getInfo(@PathVariable("id") Long id)
+    {
+        return R.ok().put("data", rechargeRecordService.selectRechargeRecordById(id));
+    }
+
+
+    /**
+     * 修改储值支付记录
+     */
+    @PreAuthorize("@ss.hasPermi('company:rechargeRecord:edit')")
+    @Log(title = "储值支付记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody RechargeRecord rechargeRecord)
+    {
+        return toAjax(rechargeRecordService.updateRechargeRecord(rechargeRecord));
+    }
+
+    /**
+     * 删除储值支付记录
+     */
+    @PreAuthorize("@ss.hasPermi('company:rechargeRecord:remove')")
+    @Log(title = "储值支付记录", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(rechargeRecordService.deleteRechargeRecordByIds(ids));
+    }
+}

+ 4 - 0
fs-company/src/main/java/com/fs/company/controller/company/RechargeRecordController.java

@@ -56,6 +56,10 @@ public class RechargeRecordController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(RechargeRecord rechargeRecord)
     {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        Long companyId = loginUser.getUser().getCompanyId();
+        rechargeRecord.setCompanyId(companyId);
+
         startPage();
         List<RechargeRecord> list = rechargeRecordService.selectRechargeRecordList(rechargeRecord);
         return getDataTable(list);

+ 2 - 2
fs-company/src/main/java/com/fs/company/controller/live/LiveController.java

@@ -183,8 +183,8 @@ public class LiveController extends BaseController
         CompanyUser user = SecurityUtils.getLoginUser().getUser();
         live.setCompanyUserId(user.getUserId());
         live.setCompanyId(user.getCompanyId());
-        return R.ok();
-//        return liveService.startLive(live);
+//        return R.ok();
+        return liveService.startLive(live);
     }
 
     /**

+ 8 - 4
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreAfterSalesScrmServiceImpl.java

@@ -869,7 +869,7 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
                 AppConfig config = new Gson().fromJson(sysConfig.getConfigValue(), AppConfig.class);
 
                 for(FsStorePaymentScrm payment:payments){
-                    if (order.getPayType().equals("99")){
+                    if (order.getPayType().equals("99")||order.getPayType().equals("5")){
                         payment.setAppId(config.getAppId());
                     }
                     if (StringUtils.isBlank(payment.getAppId())) {
@@ -879,10 +879,11 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
                     if ("wxApp".equals(payment.getPayMode())){
                         payType = "wx";
                     }
-                    MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
-                    FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
 
                     if (payment.getPayMode()==null||payment.getPayMode().equals("wx")){
+                        MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
+                        FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
+
                         WxPayConfig payConfig = new WxPayConfig();
                         payConfig.setAppId(payment.getAppId());
                         payConfig.setMchId(fsPayConfig.getWxMchId());
@@ -914,6 +915,9 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
                             return R.error("退款请求失败"+e.getErrCodeDes());
                         }
                     }else if (payment.getPayMode()!=null&&payment.getPayMode().equals("hf")){
+                        MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
+                        FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
+
                         String huifuId="";
                         if (payment.getAppId() != null) {
                             if (merchantAppConfig == null){
@@ -1067,7 +1071,7 @@ public class FsStoreAfterSalesScrmServiceImpl implements IFsStoreAfterSalesScrmS
         record.setTransactionId(generateTransactionId());
         record.setOrderId(orderId);
         record.setOrderNo(orderNo);
-        record.setBusinessType(1); // 1-消费
+        record.setBusinessType(2); // 1-消费
         if (ObjectUtil.isEmpty(company)){
             record.setRemark("订单退款,自主下单没有归属公司");
         }else {

+ 13 - 7
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -862,8 +862,10 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
     public R createOrder(long userId, FsStoreOrderCreateParam param) {
 
         FsUserCompanyUser fsUserCompanyUser = fsUserCompanyUserMapper.selectFsUserCompanyUserByUserId(userId);
-        param.setCompanyId(fsUserCompanyUser.getCompanyId());
-        param.setCompanyUserId(fsUserCompanyUser.getCompanyUserId());
+        if (ObjectUtil.isNotEmpty(fsUserCompanyUser)){
+            param.setCompanyId(fsUserCompanyUser.getCompanyId());
+            param.setCompanyUserId(fsUserCompanyUser.getCompanyUserId());
+        }
 
         if (!CloudHostUtils.hasCloudHostName("鹤颜堂")){
             log.error("进入到数据");
@@ -2522,7 +2524,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             }
 
         }
-        if (order.getPayType().equals(3)) {
+        if (order.getPayType().equals("3")) {
             //货到付款
         } else {
             //将钱退还给用户
@@ -2532,7 +2534,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                 AppConfig config = new Gson().fromJson(sysConfig.getConfigValue(), AppConfig.class);
 
                 for (FsStorePaymentScrm payment : payments) {
-                    if (order.getPayType().equals("99")){
+                    if (order.getPayType().equals("99")||order.getPayType().equals("5")){
                         payment.setAppId(config.getAppId());
                     }
                     if (StringUtils.isBlank(payment.getAppId())) {
@@ -2542,10 +2544,11 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                     if ("wxApp".equals(payment.getPayMode())){
                         payType = "wx";
                     }
-                    MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
-                    FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
 
                     if (payment.getPayMode() == null || payment.getPayMode().equals("wx")) {
+                        MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
+                        FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
+
                         WxPayConfig payConfig = new WxPayConfig();
                         payConfig.setAppId(payment.getAppId());
                         payConfig.setMchId(fsPayConfig.getWxMchId());
@@ -2576,6 +2579,9 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                             return R.error("退款请求失败" + e.getErrCodeDes());
                         }
                     } else if (payment.getPayMode() != null && payment.getPayMode().equals("hf")) {
+                        MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
+                        FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
+
                         String huifuId="";
                         if (payment.getAppId() != null) {
                             if (merchantAppConfig == null){
@@ -2795,7 +2801,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         record.setTransactionId(generateTransactionId());
         record.setOrderId(orderId);
         record.setOrderNo(orderNo);
-        record.setBusinessType(1); // 1-消费
+        record.setBusinessType(2); // 1-消费
         if (ObjectUtil.isEmpty(company)){
             record.setRemark("订单退款,自主下单没有归属公司");
         }else {

+ 26 - 10
fs-service/src/main/java/com/fs/live/service/impl/LiveOrderServiceImpl.java

@@ -55,9 +55,11 @@ import com.fs.config.cloud.CloudHostProper;
 import com.fs.core.config.WxMaConfiguration;
 import com.fs.core.utils.OrderCodeUtils;
 import com.fs.course.domain.FsCoursePlaySourceConfig;
+import com.fs.course.domain.FsUserCompanyUser;
 import com.fs.course.dto.FsOrderDeliveryNoteDTO;
 import com.fs.course.dto.OrderOpenIdTransDTO;
 import com.fs.course.mapper.FsCoursePlaySourceConfigMapper;
+import com.fs.course.mapper.FsUserCompanyUserMapper;
 import com.fs.erp.domain.*;
 import com.fs.erp.dto.*;
 import com.fs.erp.mapper.FsErpFinishPushMapper;
@@ -166,6 +168,9 @@ import static com.fs.hisStore.constants.StoreConstants.DELIVERY;
 public class LiveOrderServiceImpl implements ILiveOrderService {
 
     private final RedisCache redisCache;
+
+    @Autowired
+    private FsUserCompanyUserMapper fsUserCompanyUserMapper;
     @Autowired
     private LiveOrderMapper baseMapper;
     @Autowired
@@ -1467,7 +1472,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                 SysConfig sysConfig = configService.selectConfigByConfigKey("app.config");
                 AppConfig config = new Gson().fromJson(sysConfig.getConfigValue(), AppConfig.class);
                 for (LiveOrderPayment payment : payments) {
-                    if (order.getPayType().equals("99")){
+                    if (order.getPayType().equals("99")||order.getPayType().equals("5")){
                         payment.setAppId(config.getAppId());
                     }
 //                   payment.setAppId(config.getAppId());
@@ -1476,11 +1481,11 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                     if ("wxApp".equals(payment.getPayMode())){
                         payType = "wx";
                     }
-                    MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
-
-                    FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
 
                     if (payment.getPayMode() == null || "wx".equals(payment.getPayMode())) {
+                        MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
+                        FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
+
                         WxPayConfig payConfig = new WxPayConfig();
                         payConfig.setAppId(fsPayConfig.getAppId());
                         payConfig.setMchId(fsPayConfig.getWxMchId());
@@ -1513,6 +1518,9 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                             return R.error("退款请求失败" + e.getErrCodeDes());
                         }
                     } else if (payment.getPayMode() != null && "hf".equals(payment.getPayMode())) {
+                        MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
+                        FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
+
                         String huifuId = "";
                         if (payment.getAppId() != null) {
                             if (merchantAppConfig != null) {
@@ -1662,7 +1670,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
         record.setTransactionId(generateTransactionId());
         record.setOrderId(orderId);
         record.setOrderNo(orderNo);
-        record.setBusinessType(1); // 1-消费
+        record.setBusinessType(2); // 1-消费
         if (ObjectUtil.isEmpty(company)){
             record.setRemark("直播订单退款,自主下单没有归属公司");
         }else {
@@ -1817,7 +1825,7 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                 AppConfig config = new Gson().fromJson(sysConfig.getConfigValue(), AppConfig.class);
 
                 for (LiveOrderPayment payment : payments) {
-                    if (order.getPayType().equals("99")){
+                    if (order.getPayType().equals("99")||order.getPayType().equals("5")){
                         payment.setAppId(config.getAppId());
                     }
                     if (StringUtils.isBlank(payment.getAppId())) {
@@ -1827,10 +1835,10 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                     if ("wxApp".equals(payment.getPayMode())){
                         payType = "wx";
                     }
-                    MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
-                    FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
 
                     if (payment.getPayMode() == null || "wx".equals(payment.getPayMode())) {
+                        MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
+                        FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
                         WxPayConfig payConfig = new WxPayConfig();
                         payConfig.setAppId(payment.getAppId());
                         payConfig.setMchId(fsPayConfig.getWxMchId());
@@ -1861,6 +1869,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
                             return R.error("退款请求失败" + e.getErrCodeDes());
                         }
                     } else if (payment.getPayMode() != null && "hf".equals(payment.getPayMode())) {
+                        MerchantAppConfig merchantAppConfig = merchantAppConfigMapper.selectMerchantAppConfigByAppId(payment.getAppId(),payType);
+                        FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
                         String huifuId = "";
                         if (payment.getAppId() != null) {
                             if (merchantAppConfig == null){
@@ -4442,6 +4452,12 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
 //        if (StringUtils.isEmpty(orderKey)) {
 //            return R.error("订单已过期");
 //        }
+        FsUserCompanyUser fsUserCompanyUser = fsUserCompanyUserMapper.selectFsUserCompanyUserByUserId(Long.valueOf(liveOrder.getUserId()));
+        if (ObjectUtil.isNotEmpty(fsUserCompanyUser)){
+            liveOrder.setCompanyId(fsUserCompanyUser.getCompanyId());
+            liveOrder.setCompanyUserId(fsUserCompanyUser.getCompanyUserId());
+        }
+
         if (liveOrder.getLiveId() == null) return R.error("直播ID不能为空");
         if (liveOrder.getProductId() == null) return R.error("购物商品ID不能为空");
         if (liveOrder.getUserName() == null) return R.error("用户名不能为空");
@@ -4528,8 +4544,8 @@ public class LiveOrderServiceImpl implements ILiveOrderService {
 
         LiveUserFirstEntry liveUserFirstEntry = liveUserFirstEntryService.selectEntityByLiveIdUserId(liveOrder.getLiveId(), Long.parseLong(liveOrder.getUserId()));
         if (ObjectUtil.isNotEmpty(liveUserFirstEntry)) {
-            liveOrder.setCompanyId(liveUserFirstEntry.getCompanyId());
-            liveOrder.setCompanyUserId(liveUserFirstEntry.getCompanyUserId());
+//            liveOrder.setCompanyId(liveUserFirstEntry.getCompanyId());
+//            liveOrder.setCompanyUserId(liveUserFirstEntry.getCompanyUserId());
             liveOrder.setTuiUserId(liveUserFirstEntry.getCompanyUserId());
         }
         String orderSn = OrderCodeUtils.getOrderSn();

+ 7 - 6
fs-service/src/main/resources/application-druid-zkzh.yml

@@ -128,14 +128,15 @@ spring:
                         config:
                             multi-statement-allow: true
 rocketmq:
-    name-server: rmq-16e437k44e.rocketmq.cd.qcloud.tencenttdmq.com:8080 # 替换为实际的
+    name-server: rmq-1243b25nj.rocketmq.gz.public.tencenttdmq.com:8080 # RocketMQ NameServer 地址
     producer:
-        group: conversion-tracking-group
-        access-key: ak16e437k44e83e6c22f3b48 # 替换为实际的 accessKey
-        secret-key: ske995168f7b31620b # 替换为实际的 secretKey
+        group: my-producer-group
+        access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
+        secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
     consumer:
-        access-key: ak16e437k44e83e6c22f3b48 # 替换为实际的 accessKey
-        secret-key: ske995168f7b31620b # 替换为实际的 secretKey
+        group: test-group
+        access-key: ak1243b25nj17d4b2dc1a03 # 替换为实际的 accessKey
+        secret-key: sk08a7ea1f9f4b0237 # 替换为实际的 secretKey
 cloud_host:
     company_name: 中康智慧
 openIM: