Quellcode durchsuchen

1、福袋发放返回数据

yfh vor 3 Wochen
Ursprung
Commit
26c6022859

+ 10 - 5
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -4734,9 +4734,11 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
             expireDateTime = expireDateTime.toLocalDate().atTime(23, 59, 59);
             Date updateTime = Date.from(expireDateTime.atZone(ZoneId.systemDefault()).toInstant());
 
-            Long businessId = addLuckyBagCollectRecord(param.getLuckyBagId(),param.getUserId(),updateTime,String.valueOf(param.getCompanyUserId()),String.valueOf(param.getCompanyId()));
-
-            return R.ok().put("data",businessId);
+            Map<String,Object> business = addLuckyBagCollectRecord(param.getLuckyBagId(),param.getUserId(),updateTime,String.valueOf(param.getCompanyUserId()),String.valueOf(param.getCompanyId()));
+            String json = configService.selectConfigByKey("luckyBag.config");
+            Map<String, Object> luckyBagConfig = JSON.parseObject(json, Map.class);
+            business.put("img",luckyBagConfig.get("miniprogramPicUrl"));
+            return R.ok().put("data",business);
         }catch (Exception e){
             e.printStackTrace();
             return R.error("发放福袋失败!");
@@ -4754,7 +4756,7 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
      * @param companyId
      * @return
      */
-    private Long addLuckyBagCollectRecord(Long luckyBagId,
+    private Map<String,Object> addLuckyBagCollectRecord(Long luckyBagId,
                                           Long userId,
                                           Date sendTime,
                                           String companyUserId,
@@ -4810,7 +4812,10 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
             }
 
             log.info("福袋记录添加成功 [recordId:{}, luckyBagId:{}]", recordId, luckyBagId);
-            return recordId;
+            Map<String,Object> map = new HashMap<>();
+            map.put("recordId",recordId);
+            map.put("luckyBag",luckyBag);
+            return map;
 
         } catch (NumberFormatException e) {
             log.error("ID转换失败 [companyId:{}, companyUserId:{}]", companyId, companyUserId, e);