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

Commit 6c0433f9 authored by 胡佳晨's avatar 胡佳晨

提交 消费

parent 0c53da83
...@@ -17,6 +17,7 @@ import org.springframework.data.redis.stream.StreamListener; ...@@ -17,6 +17,7 @@ import org.springframework.data.redis.stream.StreamListener;
import java.net.URL; import java.net.URL;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.Map; import java.util.Map;
...@@ -87,34 +88,35 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String, ...@@ -87,34 +88,35 @@ public abstract class AbstractXlsRedisReceiver implements StreamListener<String,
objs.add(new Object[]{skuId, xlsPath, type, 1, LocalDateTime.now()}); objs.add(new Object[]{skuId, xlsPath, type, 1, LocalDateTime.now()});
aBoolean = baseDao.batchSql(SQL_INSERT_GOODS_BUY_ROSTER_LOG, objs); aBoolean = baseDao.batchSql(SQL_INSERT_GOODS_BUY_ROSTER_LOG, objs);
} else if (finalType.equals(3) || finalType.equals(4)) { } else if (finalType.equals(3) || finalType.equals(4)) {
if (xlsPath != null) {//添加 if (xlsPath != null && !xlsPath.equals("")) {//添加
EasyExcel.read(new URL(xlsPath).openStream(), PhoneUnIdDto.class, new PageReadListener<PhoneUnIdDto>(dataList -> { EasyExcel.read(new URL(xlsPath).openStream(), new PageReadListener<HashMap<String, String>>(dataList -> {
for (PhoneUnIdDto data : dataList) { for (HashMap<String, String> data : dataList) {
if (data.getMobile() == null) { if (data.get(0) == null) {
continue; continue;
} }
if (finalType.equals(3)) { if (finalType.equals(3)) {
redisUtil.set(GoblinRedisConst.REDIS_WHITE.concat(finalSkuId + ":").concat(data.getMobile()), 1); redisUtil.set(GoblinRedisConst.REDIS_WHITE.concat(finalSkuId + ":").concat(data.get(0)), 1);
} else { } else {
redisUtil.set(GoblinRedisConst.REDIS_BLACK.concat(finalSkuId + ":").concat(data.getMobile()), 1); redisUtil.set(GoblinRedisConst.REDIS_BLACK.concat(finalSkuId + ":").concat(data.get(0)), 1);
} }
} }
})).sheet().doRead(); })).sheet().doRead();
} }
if (oXlsPath != null) {//删除旧的黑白名单 if (oXlsPath != null&& !oXlsPath.equals("")) {//删除旧的黑白名单
EasyExcel.read(new URL(oXlsPath).openStream(), PhoneUnIdDto.class, new PageReadListener<PhoneUnIdDto>(dataList -> { EasyExcel.read(new URL(oXlsPath).openStream(), new PageReadListener<HashMap<String, String>>(dataList -> {
for (PhoneUnIdDto data : dataList) { for (HashMap<String, String> data : dataList) {
if (data.getMobile() == null) { if (data.get(0) == null) {
continue; continue;
} }
if (finalType.equals(3)) { if (finalType.equals(3)) {
redisUtil.del(GoblinRedisConst.REDIS_WHITE.concat(finalSkuId + ":").concat(data.getMobile())); redisUtil.del(GoblinRedisConst.REDIS_WHITE.concat(finalSkuId + ":").concat(data.get(0)));
} else { } else {
redisUtil.del(GoblinRedisConst.REDIS_BLACK.concat(finalSkuId + ":").concat(data.getMobile())); redisUtil.del(GoblinRedisConst.REDIS_BLACK.concat(finalSkuId + ":").concat(data.get(0)));
} }
} }
})).sheet().doRead(); })).sheet().doRead();
} }
aBoolean = true;
} }
} catch (Exception e) { } catch (Exception e) {
log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), message, e); log.error("CONSUMER MSG EX_HANDLE ==> [{}]:{}", this.getRedisStreamKey(), message, e);
......
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