Commit bb227821 by 杨林龙

添加假性离线消费测试用例

1 parent 65aff14d
......@@ -6,7 +6,9 @@ import cn.com.glsx.kafka.service.FakeOfficeService;
import cn.com.glsx.stdinterface.dto.FakeOfflineFenceSnDto;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.glsx.plat.common.utils.DateUtils;
import com.glsx.plat.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -29,7 +31,6 @@ public class FakeOfficeConsumer extends MessageReceiver {
public void processMessage(String topic, byte[] message) throws Exception {
try {
FakeOfflineFence.FakeOfflineInfo fakeOfflineInfo = FakeOfflineFence.FakeOfflineInfo.parseFrom(message);
log.info("假性离线消费接收参数为:" + JSONUtil.toJsonStr(fakeOfflineInfo));
// 数据转换
FakeOfflineFenceSnDto fakeOfflineFenceSnDto = convert(fakeOfflineInfo);
log.info("假性离线消费转换参数为:" + JSONUtil.toJsonStr(fakeOfflineFenceSnDto));
......@@ -54,8 +55,8 @@ public class FakeOfficeConsumer extends MessageReceiver {
// 大数据的驶入状态对应业务侧在围栏内类型
.setStatus(fakeOfflineInfo.getTriggerType())
.setMerchantType(fakeOfflineInfo.getMerchantType())
.setEntryTime(fakeOfflineInfo.getEnterTime() == null ? null : DateUtils.parse(fakeOfflineInfo.getEnterTime()))
.setOutTime(fakeOfflineInfo.getOutTime() == null ? null : DateUtils.parse(fakeOfflineInfo.getOutTime()))
.setEntryTime(StringUtils.isEmpty(fakeOfflineInfo.getEnterTime()) ? null : DateUtils.parse(fakeOfflineInfo.getEnterTime()))
.setOutTime(StringUtils.isEmpty(fakeOfflineInfo.getOutTime()) ? null : DateUtils.parse(fakeOfflineInfo.getOutTime()))
.setAddr(fakeOfflineInfo.getAddr())
.setUniqueFlag(fakeOfflineInfo.getDevicesn().concat(String.valueOf(fakeOfflineInfo.getTriggerType())).concat(String.valueOf(fakeOfflineInfo.getTriggerTime())));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!