提交代码

dev-discount
胡锐 3 years ago
parent 32b29a06f0
commit bb3a57d33e
  1. 1
      hai-cweb/src/main/java/com/cweb/config/AuthConfig.java
  2. 25
      hai-cweb/src/main/java/com/cweb/controller/HighActivityController.java
  3. 16
      hai-service/src/main/java/com/hai/dao/HighActivityAwardUserMapperExt.java
  4. 11
      hai-service/src/main/java/com/hai/service/HighActivityAwardUserService.java
  5. 7
      hai-service/src/main/java/com/hai/service/impl/HighActivityAwardUserServiceImpl.java

@ -104,6 +104,7 @@ public class AuthConfig implements WebMvcConfigurer {
.excludePathPatterns("/highMerchantStore/getStoreListByMerchant")
.excludePathPatterns("/sms/sendSmsCode")
.excludePathPatterns("/sms/getSmsCode")
.excludePathPatterns("/activity/getWinLotteryList")
.excludePathPatterns("/user/login")
.excludePathPatterns("/user/getUnionId")
.excludePathPatterns("/order/orderToH5Pay")

@ -15,6 +15,7 @@ import com.hai.enum_type.ActivityInfoStatus;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.service.HighActivityAwardService;
import com.hai.service.HighActivityAwardUserService;
import com.hai.service.HighActivityInfoService;
import com.hai.service.HighActivityUserLotteryNumService;
import com.mysql.jdbc.exceptions.jdbc4.MySQLTransactionRollbackException;
@ -53,6 +54,9 @@ public class HighActivityController {
@Resource
private HighActivityAwardService highActivityAwardService;
@Resource
private HighActivityAwardUserService highActivityAwardUserService;
@Resource
private HighActivityUserLotteryNumService highActivityUserLotteryNumService;
@ -69,7 +73,6 @@ public class HighActivityController {
log.error("HighActivityController --> lottery() error!", "参数错误");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 活动信息
HighActivityInfo activityInfo = highActivityInfoService.getDetailById(body.getLong("activityId"));
if (activityInfo == null) {
@ -102,10 +105,10 @@ public class HighActivityController {
}
}
@RequestMapping(value="/getLotteryNum",method = RequestMethod.GET)
@RequestMapping(value="/getUserLotteryNum",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询抽奖数量")
public ResponseData getLotteryNum(@RequestParam(name = "activityId", required = true) Long activityId,
@ApiOperation(value = "获取用户抽奖次数")
public ResponseData getUserLotteryNum(@RequestParam(name = "activityId", required = true) Long activityId,
HttpServletRequest request) {
try {
// 用户
@ -160,5 +163,19 @@ public class HighActivityController {
}
}
@RequestMapping(value="/getWinLotteryList",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "查询中奖记录")
public ResponseData getWinLotteryList(@RequestParam(name = "activityId", required = true) Long activityId) {
try {
return ResponseMsgUtil.success(highActivityAwardUserService.getWinLotteryList(activityId));
} catch (Exception e) {
log.error("HighActivityController -> getWinLotteryList() error!",e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -1,7 +1,21 @@
package com.hai.dao;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
import java.util.Map;
/**
* mapper扩展类
*/
public interface HighActivityAwardUserMapperExt {
}
@Select(" select insert(b.phone, 4, 4, '****') phone,a.name awardName,a.create_time receiveTime from \n" +
" (select a.create_time, b.name,a.user_id " +
" from high_activity_award_user a,high_activity_award b " +
" where a.activity_award_id = b.id and a.activity_info_id = #{activityId} " +
" ORDER BY a.create_time desc LIMIT 50) a" +
" LEFT JOIN high_user b on b.id = a.user_id")
List<Map<String, Object>> selectWinLotteryList(@Param("activityId") Long activityId);
}

@ -1,5 +1,8 @@
package com.hai.service;
import java.util.List;
import java.util.Map;
/**
* @author hurui
*/
@ -9,4 +12,12 @@ public interface HighActivityAwardUserService {
* 增加用户中奖记录
*/
void insertAwardUser(Long serialNumId,Long userId);
/**
* 此方法请勿随意调用与修改因为这个是专门对外开放的
* 根据活动查询中奖记录
* @param activityId
* @return
*/
List<Map<String, Object>> getWinLotteryList(Long activityId);
}

@ -9,6 +9,8 @@ import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service("highActivityAwardUserService")
public class HighActivityAwardUserServiceImpl implements HighActivityAwardUserService {
@ -33,4 +35,9 @@ public class HighActivityAwardUserServiceImpl implements HighActivityAwardUserSe
highActivityAwardUserMapper.insert(awardUser);
}
}
@Override
public List<Map<String, Object>> getWinLotteryList(Long activityId) {
return highActivityAwardUserMapper.selectWinLotteryList(activityId);
}
}

Loading…
Cancel
Save