Commit 55c66dca by 墨竹

Merge branch 'fixbug_0429' into developer

parents 1dfe38e7 80f1b4ee
package com.gic.haoban.manage.service.service.out.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.haoban.common.utils.EntityUtil;
......@@ -45,6 +47,8 @@ public class QywxErrorLogApiServiceImpl implements QywxErrorLogApiService {
@Override
public Page<QywxErrorLogDTO> queryListByPage(QywxErrorLogListQDTO qywxErrorLogListQDTO) {
qywxErrorLogListQDTO.setStartDate(DateUtil.format(DateUtil.beginOfDay(DateUtil.parse(qywxErrorLogListQDTO.getStartDate())), DatePattern.NORM_DATETIME_PATTERN));
qywxErrorLogListQDTO.setEndDate(DateUtil.format(DateUtil.beginOfDay(DateUtil.parse(qywxErrorLogListQDTO.getEndDate())), DatePattern.NORM_DATETIME_PATTERN));
PageHelper.startPage(qywxErrorLogListQDTO.getPageNum(), qywxErrorLogListQDTO.getPageSize());
List<TabQywxErrorLog> list = this.tabQywxErrorLogService.queryListByPage(qywxErrorLogListQDTO);
return PageUtil.changePageHelperToCurrentPage(new PageInfo<>(list), QywxErrorLogDTO.class);
......
......@@ -26,7 +26,6 @@ import com.gic.member.api.service.MemberTagService;
import com.gic.member.tag.api.dto.MemberTagItemDTO;
import com.gic.member.tag.api.service.MemberTagItemApiService;
import com.gic.mq.sdk.GicMQClient;
import com.gic.redis.data.util.RedisUtil;
import com.gic.wechat.api.dto.qywx.QywxTagDTO;
import com.gic.wechat.api.dto.qywx.QywxTagGroupDTO;
import com.gic.wechat.api.dto.qywx.response.QywxGetCorpTagListDTO;
......@@ -37,9 +36,6 @@ import com.google.common.collect.Sets;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.redisson.api.RRateLimiter;
import org.redisson.api.RateIntervalUnit;
import org.redisson.api.RateType;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -555,9 +551,6 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger.info("不需要操作:{},{}", wxUserId, externalUserId);
return;
}
RRateLimiter rateLimiter = RedisUtil.getRedisClient().getRateLimiter("qywx:tag:limit");
rateLimiter.trySetRate(RateType.OVERALL, 5, 1, RateIntervalUnit.SECONDS);
rateLimiter.acquire();
QywxResponseDTO responseDTO = qywxUserApiService.markTag(wxEnterprise.getCorpid(), config.getWxSuiteid(), wxUserId, externalUserId, needSetTags, needDelTags);
logger.info("操作返回:{}", JSONObject.toJSONString(responseDTO));
if (responseDTO.getErrcode() != 0) {
......
......@@ -357,15 +357,20 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
BeanUtils.copyProperties(staffPrivacyUseLogDTO, staffPrivacyUseLogBO);
String staffId = staffPrivacyUseLogDTO.getStaffId();
if (StringUtils.isBlank(staffId) || "-1".equals(staffId)) {
StaffPrivacyUseLogBO privacyUseLogBO = staffPrivacyUseLogService.getByUserId(staffPrivacyUseLogDTO.getWxOpenUseId());
if (privacyUseLogBO == null) {
staffPrivacyUseLogService.insert(staffPrivacyUseLogBO);
String wxOpenUseId = staffPrivacyUseLogDTO.getWxOpenUseId();
StaffPrivacyUseLogBO privacyUseLogBO = staffPrivacyUseLogService.getByUserId(wxOpenUseId);
if (privacyUseLogBO != null) {
log.info("用户已经同意过隐私协议,wxOpenUseId:{}", wxOpenUseId);
return;
}
staffPrivacyUseLogService.insert(staffPrivacyUseLogBO);
} else {
StaffPrivacyUseLogBO privacyUseLog = staffPrivacyUseLogService.getByStaffId(staffId);
if (privacyUseLog == null) {
staffPrivacyUseLogService.insert(staffPrivacyUseLogBO);
if (privacyUseLog != null) {
log.info("用户已经同意过隐私协议,staffId:{}", staffId);
return;
}
staffPrivacyUseLogService.insert(staffPrivacyUseLogBO);
}
}
}
......@@ -160,6 +160,7 @@
and create_time <![CDATA[ <= ]]> #{endDate}
</if>
</where>
order by create_time desc
</select>
</mapper>
......@@ -215,11 +215,6 @@ public class WxEnterpriseInfoController extends WebBaseController {
*/
private RestResponse<String> wellDoneTouristsLogin(StaffLoginQO staffLoginQO, HttpServletRequest request, String staffId, String wxOpenUseId) {
logger.info("游客登录,wxOpenUseId:{}", wxOpenUseId);
//登录和刷新token兼容
String headerToken = AuthRequestWellDoneUtil.getHeaderToken();
if (StringUtils.isNotBlank(headerToken)) {
return getRefreshTokenResult(getRefreshToken());
}
Map<String, String> map = new HashMap<>();
map.put("staffId", "-1");
map.put("wxOpenUseId", wxOpenUseId);
......@@ -274,11 +269,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
if (StringUtils.isBlank(phoneNumber)) {
return RestResponse.failure(String.valueOf(HaoBanErrCode.ERR_600002.getCode()), HaoBanErrCode.ERR_600002.getMsg());
}
//登录和刷新token兼容
String headerToken = AuthRequestWellDoneUtil.getHeaderToken();
if (StringUtils.isNotBlank(headerToken)) {
return getRefreshTokenResult(getRefreshToken());
}
Map<String, String> map = new HashMap<>();
map.put("staffId", staffId);
map.put("wxEnterpriseId", staffDTO.getWxEnterpriseId());
......@@ -291,6 +282,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
privacyUseLogDTO.setWxEnterpriseId(staffDTO.getWxEnterpriseId());
privacyUseLogDTO.setPhoneNumber(phoneNumber);
privacyUseLogDTO.setWxUserId(staffDTO.getWxUserId());
privacyUseLogDTO.setWxOpenUseId(staffDTO.getWxOpenUseId());
wxEnterpriseApiService.wellDoneLoginAddPrivacy(privacyUseLogDTO);
return RestResponse.successResult(token);
}
......
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