zx преди 14 часа
родител
ревизия
f1d98a74c5

+ 2 - 0
fs-company/src/main/java/com/fs/company/controller/course/FsCourseRedPacketLogController.java

@@ -1,6 +1,7 @@
 package com.fs.company.controller.course;
 
 import com.fs.common.annotation.Log;
+import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
 import com.fs.common.core.domain.R;
@@ -203,6 +204,7 @@ public class FsCourseRedPacketLogController extends BaseController
 
     @Log(title = "短链课程看课记录", businessType = BusinessType.DELETE)
     @PutMapping("/retryCourseRedPacketLog/{logIds}")
+    @RepeatSubmit
     public R retryCourseRedPacketLog(@PathVariable Long[] logIds)
     {
         return fsCourseRedPacketLogService.retryCourseRedPacketLog(logIds);

+ 14 - 4
fs-service/src/main/java/com/fs/course/service/impl/FsCourseRedPacketLogServiceImpl.java

@@ -12,6 +12,8 @@ import com.fs.company.domain.Company;
 import com.fs.company.domain.CompanyMoneyLogs;
 import com.fs.company.mapper.CompanyMapper;
 import com.fs.company.mapper.CompanyMoneyLogsMapper;
+import com.fs.course.domain.FsCourseWatchLog;
+import com.fs.course.mapper.FsCourseWatchLogMapper;
 import com.fs.course.param.FsCourseRedPacketLogParam;
 import com.fs.course.vo.FsCourseRedPacketLogListPVO;
 import com.fs.his.domain.FsUser;
@@ -37,7 +39,8 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
 {
     @Autowired
     private FsCourseRedPacketLogMapper fsCourseRedPacketLogMapper;
-
+    @Autowired
+    private CompanyMapper companyMapper;
     /**
      * 查询短链课程看课记录
      *
@@ -162,7 +165,7 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
     @Autowired
     private FsUserMapper fsUserMapper;
     @Autowired
-    private CompanyMapper companyMapper;
+    private FsCourseWatchLogMapper courseWatchLogMapper;
     @Autowired
     private CompanyMoneyLogsMapper moneyLogsMapper;
     @Override
@@ -202,7 +205,12 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
                     }else {
                         redPacketLog.setOutBatchNo(sendRedPacket.get("orderCode").toString());
                     }
+                    FsCourseWatchLog log = new FsCourseWatchLog();
+                    log.setLogId(param.getWatchLogId());
+                    log.setRewardType(1);
+                    courseWatchLogMapper.updateFsCourseWatchLog(log);
                     // 添加红包记录
+                    redPacketLog.setLogId(param.getLogId());
                     redPacketLog.setStatus(0);
                     fsCourseRedPacketLogMapper.updateFsCourseRedPacketLog(redPacketLog);
                     // 更新观看记录的奖励类型
@@ -217,13 +225,15 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
                     logs.setCreateTime(new Date());
                     moneyLogsMapper.insertCompanyMoneyLogs(logs);
                     suc++;
+                }else {
+                    err++;
                 }
             }else {
-                err=0;
+                err++;
             }
 
         }
-        return R.ok();
+        return R.ok("成功:"+suc+" 失败:"+err);
     }
 
 }