|
@@ -2,7 +2,12 @@ package com.ym.mec.student.controller;
|
|
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
|
|
+import com.ym.mec.biz.dal.dto.HorseRaceLampDto;
|
|
|
|
|
+import com.ym.mec.biz.dal.entity.ActivityDetailDto;
|
|
|
|
|
+import com.ym.mec.biz.dal.entity.LuckDrawCount;
|
|
|
import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
|
|
import com.ym.mec.biz.dal.entity.SporadicChargeInfo;
|
|
|
|
|
+import com.ym.mec.biz.service.LuckDrawCountService;
|
|
|
|
|
+import com.ym.mec.biz.service.LuckDrawPrizeService;
|
|
|
import com.ym.mec.biz.service.MarketActivityService;
|
|
import com.ym.mec.biz.service.MarketActivityService;
|
|
|
import com.ym.mec.biz.service.SporadicChargeInfoService;
|
|
import com.ym.mec.biz.service.SporadicChargeInfoService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
import com.ym.mec.common.controller.BaseController;
|
|
@@ -14,7 +19,10 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import java.util.Comparator;
|
|
import java.util.Comparator;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.logging.Handler;
|
|
|
|
|
|
|
|
@RequestMapping("activity")
|
|
@RequestMapping("activity")
|
|
|
@Api(tags = "活动")
|
|
@Api(tags = "活动")
|
|
@@ -26,6 +34,10 @@ public class ActivityController extends BaseController {
|
|
|
private SporadicChargeInfoService sporadicChargeInfoService;
|
|
private SporadicChargeInfoService sporadicChargeInfoService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private MarketActivityService marketActivityService;
|
|
private MarketActivityService marketActivityService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private LuckDrawPrizeService luckDrawPrizeService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private LuckDrawCountService luckDrawCountService;
|
|
|
|
|
|
|
|
@ApiOperation(value = "分部双11活动信息")
|
|
@ApiOperation(value = "分部双11活动信息")
|
|
|
@GetMapping("/doubleEleven2020")
|
|
@GetMapping("/doubleEleven2020")
|
|
@@ -47,19 +59,25 @@ public class ActivityController extends BaseController {
|
|
|
return succeed(activeInfos);
|
|
return succeed(activeInfos);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// @ApiOperation(value = "分部双11活动信息")
|
|
|
|
|
-// @GetMapping("/doubleEleven2021")
|
|
|
|
|
-// public HttpResponseResult<List<SporadicChargeInfo>> doubleEleven2021() throws Exception {
|
|
|
|
|
-// SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
|
-// ActivityDetailDto
|
|
|
|
|
-// if (sysUser == null || sysUser.getId() == null) {
|
|
|
|
|
-// return failed("请先登录");
|
|
|
|
|
-// }
|
|
|
|
|
-// if (sysUser.getOrganId() == null) {
|
|
|
|
|
-// return failed("用户信息有误,没有分部信息");
|
|
|
|
|
-// }
|
|
|
|
|
-// Integer organId = sysUser.getOrganId();
|
|
|
|
|
-// marketActivityService.queryActivity(12);
|
|
|
|
|
-// return succeed(activeInfos);
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ @ApiOperation(value = "分部双11活动信息")
|
|
|
|
|
+ @RequestMapping("/doubleEleven2021")
|
|
|
|
|
+ public HttpResponseResult doubleEleven2021(){
|
|
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
|
|
+ if (sysUser == null || sysUser.getId() == null) {
|
|
|
|
|
+ return failed("请先登录");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sysUser.getOrganId() == null) {
|
|
|
|
|
+ return failed("用户信息有误,没有分部信息");
|
|
|
|
|
+ }
|
|
|
|
|
+ Map<String,Object> resultMap = new HashMap<>(3);
|
|
|
|
|
+ resultMap.put("activityDetailList",marketActivityService.queryActivity(12,sysUser.getOrganId()));
|
|
|
|
|
+ resultMap.put("horseRaceLampList",luckDrawPrizeService.queryHorseRaceLampDto(3));
|
|
|
|
|
+ LuckDrawCount luckDrawCount = luckDrawCountService.findByIdAndGroupId(sysUser.getId(),3);
|
|
|
|
|
+ if(luckDrawCount != null){
|
|
|
|
|
+ resultMap.put("drawNum",luckDrawCount.getAvailableCount());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ resultMap.put("drawNum",0);
|
|
|
|
|
+ }
|
|
|
|
|
+ return succeed(resultMap);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|