zx 1 天之前
父节点
当前提交
befb76bb96

+ 5 - 3
fs-company/src/main/java/com/fs/company/controller/course/FsCourseRedPacketLogController.java

@@ -56,6 +56,8 @@ public class FsCourseRedPacketLogController extends BaseController
         if (fsCourseRedPacketLog.getPhoneMk() != null && fsCourseRedPacketLog.getPhoneMk() != "") {
             fsCourseRedPacketLog.setPhone(encryptPhone(fsCourseRedPacketLog.getPhoneMk()));
         }
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsCourseRedPacketLog.setCompanyId( loginUser.getCompany().getCompanyId());
 
         List<FsCourseRedPacketLogListPVO> list = fsCourseRedPacketLogService.selectFsCourseRedPacketLogListVO(fsCourseRedPacketLog);
         for (FsCourseRedPacketLogListPVO fsCourseRedPacketLogListPVO : list) {
@@ -75,7 +77,7 @@ public class FsCourseRedPacketLogController extends BaseController
         startPage();
         LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
         fsCourseRedPacketLog.setCompanyId( loginUser.getCompany().getCompanyId());
-
+        fsCourseRedPacketLog.setCompanyUserId(loginUser.getUser().getUserId());
         if (fsCourseRedPacketLog.getPhoneMk() != null && fsCourseRedPacketLog.getPhoneMk() != "") {
             fsCourseRedPacketLog.setPhone(encryptPhone(fsCourseRedPacketLog.getPhoneMk()));
         }
@@ -201,9 +203,9 @@ public class FsCourseRedPacketLogController extends BaseController
 
     @Log(title = "短链课程看课记录", businessType = BusinessType.DELETE)
     @PutMapping("/retryCourseRedPacketLog/{logIds}")
-    public AjaxResult retryCourseRedPacketLog(@PathVariable Long[] logIds)
+    public R retryCourseRedPacketLog(@PathVariable Long[] logIds)
     {
-        return toAjax(fsCourseRedPacketLogService.retryCourseRedPacketLog(logIds));
+        return fsCourseRedPacketLogService.retryCourseRedPacketLog(logIds);
     }
 
     @GetMapping("/courseList")

+ 1 - 0
fs-service/src/main/java/com/fs/course/mapper/FsCourseRedPacketLogMapper.java

@@ -114,6 +114,7 @@ public interface FsCourseRedPacketLogMapper
             "<if test = ' maps.userId !=null '> and l.user_id = #{maps.userId} </if>" +
             "<if test = ' maps.watchLogId !=null '> and l.watch_log_id = #{maps.watchLogId} </if>" +
             "<if test = ' maps.companyId !=null '> and l.company_id = #{maps.companyId} </if>" +
+            "<if test = ' maps.companyUserId !=null '> and l.company_user_id = #{maps.companyUserId} </if>" +
             "<if test = ' maps.companyUserName !=null '> and cu.nick_name  like concat('%', #{maps.companyUserName}, '%') </if>" +
             "<if test = ' maps.nickName !=null '> and u.nick_name  like concat('%', #{maps.nickName}, '%') </if>" +
             "<if test = ' maps.courseId !=null '> and l.course_id = #{maps.courseId} </if>" +

+ 1 - 1
fs-service/src/main/java/com/fs/course/param/FsCourseRedPacketLogParam.java

@@ -11,7 +11,7 @@ public class FsCourseRedPacketLogParam {
     private Long userId;
 
     private Long companyId;
-
+    private Long companyUserId;
     private String companyUserName;
 
     private String nickName;

+ 1 - 1
fs-service/src/main/java/com/fs/course/service/IFsCourseRedPacketLogService.java

@@ -80,6 +80,6 @@ public interface IFsCourseRedPacketLogService
 
     BigDecimal getNewVipRedPackAmountByCompanyUserIdId(Long userId);
 
-    int retryCourseRedPacketLog(Long[] logIds);
+    R retryCourseRedPacketLog(Long[] logIds);
 
 }

+ 1 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsCourseLinkServiceImpl.java

@@ -627,7 +627,7 @@ public class FsCourseLinkServiceImpl implements IFsCourseLinkService
         JSONObject news = new JSONObject(true); // true 表示保持字段顺序
         news.put("link", linkUrl);
         news.put("title", course.getCourseName());
-        news.put("desc", param.getTitle()==null?"":param.getTitle());
+        news.put("desc", param.getTitle()==null?course.getCourseName():param.getTitle());
         news.put("imgUrl", course.getImgUrl());
         return R.ok().put("news",news);
     }

+ 8 - 7
fs-service/src/main/java/com/fs/course/service/impl/FsCourseRedPacketLogServiceImpl.java

@@ -167,7 +167,9 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
     private CompanyMoneyLogsMapper moneyLogsMapper;
     @Override
     @Transactional
-    public int retryCourseRedPacketLog(Long[] logIds) {
+    public R retryCourseRedPacketLog(Long[] logIds) {
+        int suc=0;
+        int err=0;
         for (int i = 0; i < logIds.length; i++) {
             Long id = logIds[i];
             FsCourseRedPacketLog param = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByLogId(id);
@@ -179,10 +181,8 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
                 BigDecimal money = company.getMoney();
                 BigDecimal subtract = money.subtract(amount);
                 if (subtract.compareTo(BigDecimal.ZERO)<0){
-                    return 0;
+                    err++;
                 }
-
-
                 WxSendRedPacketParam packetParam = new WxSendRedPacketParam();
                 FsUser user = fsUserMapper.selectFsUserByUserId(param.getUserId());
                 packetParam.setOpenId(user.getMaOpenId());
@@ -206,10 +206,8 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
                     redPacketLog.setStatus(0);
                     fsCourseRedPacketLogMapper.updateFsCourseRedPacketLog(redPacketLog);
                     // 更新观看记录的奖励类型
-
                     company.setMoney(subtract);
                     companyMapper.updateCompany(company);
-
                     CompanyMoneyLogs logs=new CompanyMoneyLogs();
                     logs.setCompanyId(company.getCompanyId());
                     logs.setRemark("扣除红包金额");
@@ -218,11 +216,14 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
                     logs.setBalance(company.getMoney());
                     logs.setCreateTime(new Date());
                     moneyLogsMapper.insertCompanyMoneyLogs(logs);
+                    suc++;
                 }
+            }else {
+                err=0;
             }
 
         }
-        return 0;
+        return R.ok();
     }
 
 }

+ 13 - 0
fs-service/src/main/java/com/fs/qw/vo/QwSopTempSetting2.java

@@ -113,6 +113,19 @@ public class QwSopTempSetting2 implements Serializable{
             //链接过期时间
             private String expiresDays;
 
+            /** 小程序appid */
+            private String miniprogramAppid;
+
+            /** 小程序消息标题 */
+            private String miniprogramTitle;
+
+            /** 小程序封面地址 */
+            private String miniprogramPicUrl;
+
+
+            /** 小程序page路径 */
+            private String miniprogramPage;
+
             @Override
             public Setting clone() {
                 try {

+ 4 - 1
fs-service/src/main/java/com/fs/sop/service/impl/QwSopTempServiceImpl.java

@@ -388,6 +388,7 @@ public class QwSopTempServiceImpl implements IQwSopTempService
                 QwSopTempRules rules = new QwSopTempRules();
                 rules.setTempId(temp.getId());
                 rules.setName(day.getName());
+                rules.setIsOfficial(sorts.get() == 0 ? "1" : "0");
                 rules.setTime(time);
                 rules.setContentType(2);
                 rules.setType(2);
@@ -408,10 +409,12 @@ public class QwSopTempServiceImpl implements IQwSopTempService
                 content.setContentType(3);
                 QwSopTempSetting2.Content.Setting setting = new QwSopTempSetting2.Content.Setting();
                 setting.setLinkTitle(fsUserCourse.getCourseName());
+                setting.setMiniprogramTitle(fsUserCourse.getCourseName());
+                setting.setMiniprogramPicUrl(fsUserCourse.getImgUrl());
                 setting.setIsBindUrl(1);
                 setting.setLinkDescribe(e.getTitle());
                 setting.setLinkImageUrl(fsUserCourse.getImgUrl());
-                setting.setContentType("3");
+                setting.setContentType("4");
                 content.setContent(JSON.toJSONString(setting));
                 content.setIsBindUrl(1);
                 rules.setList(Collections.singletonList(content));