|
|
|
@@ -25,13 +25,13 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ |
|
|
|
private final Logger logger = LoggerFactory.getLogger(this.getClass()); |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCuserFloatingLayerMapper WxCuserFloatingLayerMapper; |
|
|
|
WxCuserFloatingLayerMapper wxCuserFloatingLayerMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxFloatingLayerMapper WxFloatingLayerMapper; |
|
|
|
WxFloatingLayerMapper wxFloatingLayerMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WxCUserMapper WxCUserMapper; |
|
|
|
WxCUserMapper wxCUserMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@@ -39,14 +39,14 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ |
|
|
|
//1 查看是否存在用户,用户不存在 直接返回浮层信息 |
|
|
|
WxCUser user = new WxCUser(); |
|
|
|
user.setOpenId(openId); |
|
|
|
WxCUser byOpenId = WxCUserMapper.findByOpenId(user); |
|
|
|
WxCUser byOpenId = wxCUserMapper.findByOpenId(user); |
|
|
|
if (byOpenId == null) { |
|
|
|
return getWxFloatingLayer(); |
|
|
|
} |
|
|
|
//2 用户存在 查看是否已有弹出记录 没有 保存记录后返回浮层信息 |
|
|
|
WxCuserFloatingLayer wxCuserFloatingLayerQuery = new WxCuserFloatingLayer(); |
|
|
|
wxCuserFloatingLayerQuery.setUserId(byOpenId.getId()); |
|
|
|
WxCuserFloatingLayer wxCuserFloatingLayer = WxCuserFloatingLayerMapper.selectOne(new QueryWrapper<>(wxCuserFloatingLayerQuery)); |
|
|
|
WxCuserFloatingLayer wxCuserFloatingLayer = wxCuserFloatingLayerMapper.selectOne(new QueryWrapper<>(wxCuserFloatingLayerQuery)); |
|
|
|
if (wxCuserFloatingLayer == null) { |
|
|
|
saveCuserFloatingLayer(byOpenId); |
|
|
|
return getWxFloatingLayer(); |
|
|
|
@@ -62,12 +62,12 @@ public class WxCuserFloatingLayerServiceImpl implements WxCuserFloatingLayerServ |
|
|
|
wxCuserFloatingLayer.setUserId(wxCUser.getId()); |
|
|
|
wxCuserFloatingLayer.setTenantId(wxCUser.getTenantId()); |
|
|
|
wxCuserFloatingLayer.setCreateTime(new Date()); |
|
|
|
WxCuserFloatingLayerMapper.insert(wxCuserFloatingLayer); |
|
|
|
wxCuserFloatingLayerMapper.insert(wxCuserFloatingLayer); |
|
|
|
} |
|
|
|
|
|
|
|
public WxFloatingLayer getWxFloatingLayer() { |
|
|
|
WxFloatingLayer wxFloatingLayer = new WxFloatingLayer(); |
|
|
|
wxFloatingLayer.setStatus(EnumFloatingLayerStatus.STATUS_THROW_IN.getCode()); |
|
|
|
return WxFloatingLayerMapper.selectOne(new QueryWrapper<>(wxFloatingLayer)); |
|
|
|
return wxFloatingLayerMapper.selectOne(new QueryWrapper<>(wxFloatingLayer)); |
|
|
|
} |
|
|
|
} |