记得上下班打卡 | git大法好,push需谨慎

Commit 3e5a21b6 authored by wanglele's avatar wanglele

批量空投

parent 10efbde1
......@@ -41,7 +41,8 @@ public interface IGoblinNftExCodeService {
* 批量发送空投
* @param file
* @param activityId
* @param adminUid
* @return
*/
ResponseDto<Boolean> addAirdrops(MultipartFile file, GoblinNftExCodeParam goblinNftExCodeParam);
ResponseDto<Boolean> addAirdrops(MultipartFile file,String activityId,String adminUid);
}
......@@ -56,9 +56,9 @@ public class GoblinNftExCodeController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "excel空投批量发送")
@PostMapping("addAirdrops")
public ResponseDto<Boolean> addAirdrops(MultipartFile file,@RequestBody GoblinNftExCodeParam goblinNftExCodeParam) {
return iGoblinNftExCodeService.addAirdrops(file,goblinNftExCodeParam);
@PostMapping("addAirdrops/{activityId}/{adminUid}")
public ResponseDto<Boolean> addAirdrops(MultipartFile file,@PathVariable("activityId")String activityId,@PathVariable("adminUid") String adminUid) {
return iGoblinNftExCodeService.addAirdrops(file,activityId,adminUid);
}
......
......@@ -374,7 +374,7 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
}
@Override
public ResponseDto<Boolean> addAirdrops(MultipartFile file, GoblinNftExCodeParam goblinNftExCodeParam) {
public ResponseDto<Boolean> addAirdrops(MultipartFile file, String activityId, String adminUid) {
try {
// 手机号集合
StringBuffer phonestr = new StringBuffer();
......@@ -395,7 +395,7 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
List<AdamUserInfoDto> adamUserMappers = adamUserMapper.selectByPhones(phonestr.toString());
// 根据活动id获取可用兑换码
List<GoblinNftExCode> goblinNftExCodes = goblinNftExCodeMapper.selectCodeAvailableByActivityId(goblinNftExCodeParam.getActivityId());
List<GoblinNftExCode> goblinNftExCodes = goblinNftExCodeMapper.selectCodeAvailableByActivityId(activityId);
if (goblinNftExCodes.size() < adamUserMappers.size()) {
return ResponseDto.failure("可用兑换码数量不足!");
}
......@@ -412,7 +412,7 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
if (userIdList.size() == pageSize) {
StringBuffer codes = new StringBuffer();
PageHelper.startPage(i, pageSize, true);
List<GoblinNftExCode> goblinNftExCodeList = goblinNftExCodeMapper.selectCodeAvailableByActivityId(goblinNftExCodeParam.getActivityId());
List<GoblinNftExCode> goblinNftExCodeList = goblinNftExCodeMapper.selectCodeAvailableByActivityId(activityId);
for (GoblinNftExCode goblinNftExCode : goblinNftExCodeList) {
codes.append(goblinNftExCode.getCode()).append(",");
}
......@@ -421,7 +421,7 @@ public class GoblinNftExCodeServiceImpl implements IGoblinNftExCodeService {
userIds.deleteCharAt(userIds.length() - 1);
jsonObject.put("codes", codes);
jsonObject.put("userIds", userIds);
jsonObject.put("adminUid",goblinNftExCodeParam.getAdminUid());
jsonObject.put("adminUid", adminUid);
queueUtils.sendMssPhoneCodeRedis(MQConst.GoblinQueue.GOBLIN_PHONE_CODE_OPERA.getKey(), jsonObject.toJSONString());
userIdList.clear();
i++;
......
......@@ -154,7 +154,6 @@ public class GoblinNftExCodeTaskServiceImpl implements IGoblinNftExCodeTaskServi
if (bolNotUn) {
goblinNftExCodeTaskHashMap.put(goblinNftExCodeTask.getSkuId(), nftExCodeTask);
}
}
}
}
......@@ -236,8 +235,8 @@ public class GoblinNftExCodeTaskServiceImpl implements IGoblinNftExCodeTaskServi
Boolean bolTime = false;
if (!StringUtil.isEmpty(goblinNftExSkuVo)) {
// redis存储 单个sku的开始和结束时间
LocalDateTime rdExStartTime = LocalDateTime.parse(goblinNftExSkuVo.getRdStartTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); // "2019-06-26 19:00:00";
LocalDateTime rdExStopTime = LocalDateTime.parse(goblinNftExSkuVo.getRdStopTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); // "2019-06-26 19:00:00";
LocalDateTime rdExStartTime = LocalDateTime.parse(goblinNftExSkuVo.getRdStartTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
LocalDateTime rdExStopTime = LocalDateTime.parse(goblinNftExSkuVo.getRdStopTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
// 时间比对
if (exStartTime.isBefore(rdExStartTime)) {
......
......@@ -263,12 +263,12 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
Map<String, Map<String, Object>> mapMap = new HashMap<>();
Map<String, Object> objectMap = new HashMap<>();
objectMap.put("hitRatio", 30);
objectMap.put("stock", 16);
objectMap.put("stock", 1000);
mapMap.put("1", objectMap);
Map<String, Object> objectMap1 = new HashMap<>();
objectMap1.put("hitRatio", 30);
objectMap1.put("stock", 15);
objectMap1.put("stock", 1000);
mapMap.put("2", objectMap1);
Map<String, Object> objectMap2 = new HashMap<>();
......@@ -278,7 +278,7 @@ public class GoblinNftExSkuServiceImpl implements IGoblinNftExSkuService {
Map<String, Object> objectMap3 = new HashMap<>();
objectMap3.put("hitRatio", 10);
objectMap3.put("stock", 1);
objectMap3.put("stock", 1000);
mapMap.put("4", objectMap3);
Map<String, Integer> stockMap = new HashMap<>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment