Commit a05e5257 by 墨竹

fix:加好友逻辑修改

parent 268f46e0
......@@ -9,4 +9,13 @@ public class Manage3Constants {
* 企业微信报错日志消息路由
*/
public static final String QYWX_ERROR_MSG = "addQywxErrorLogMq";
/**
* 活码前缀
*/
public static final String HM = "HM";
/**
* 链接前缀
*/
public static final String DT = "DT";
}
......@@ -55,7 +55,17 @@ public interface HmQrcodeApiService {
* @author mozhu
* @date 2022-07-05 10:59:03
*/
HmQrcodeDTO queryById(Long hmId);
HmQrcodeDTO getDetailById(Long hmId);
/**
* 查询详情简单
*
* @param hmId hm id
* @return {@link HmQrcodeDTO }
* @author mozhu
* @date 2022-07-15 16:32:10
*/
HmQrcodeDTO getSimpleById(Long hmId);
/**
......@@ -142,4 +152,28 @@ public interface HmQrcodeApiService {
* @return
*/
ServiceResponse<Boolean> batchUpdateHmQrcodeGroup(List<Long> hmIds, Long groupId);
/**
* 根据活码id和导购id查询数据
*
* @param hmId hm id
* @param clerkId 职员id
* @return {@link HmClerkRelationDTO }
* @author mozhu
* @date 2022-07-15 16:36:29
*/
HmClerkRelationDTO getHmClerkByHmIdAndClerkId(Long hmId,String clerkId);
/**
* 根据活码id随机找一个
*
* @param hmId hm id
* @return {@link HmClerkRelationDTO }
* @author mozhu
* @date 2022-07-15 16:48:42
*/
HmClerkRelationDTO getOneHmClerkByHmId(Long hmId);
}
......@@ -14,7 +14,6 @@ import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.base.api.common.errCode.HaoBanErrCodeCommon;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.qdto.hm.WxUserAddLogQDTO;
import com.gic.haoban.manage.api.enums.AlertTypeEnum;
import com.gic.haoban.manage.api.service.CheckQywxSettingApiService;
import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
......@@ -214,21 +213,8 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
//回调给会员,更新是否为企微好友
log.info("通知会员 合并会员后更新为企微好友,memberId:{}", memberId);
memberApiService.updateMemberQywxFlag(enterpriseId, memberId, 1);
if (StringUtils.isNotBlank(memberId)) {
//添加日志
WxUserAddLogQDTO wxUserAddLogQDTO = new WxUserAddLogQDTO();
wxUserAddLogQDTO.setWxEnterpriseId(wxEnterpriseId);
wxUserAddLogQDTO.setEnterpriseId(enterpriseId);
wxUserAddLogQDTO.setMemberId(memberId);
wxUserAddLogQDTO.setUnionid(unionid);
wxUserAddLogQDTO.setDelFlag(false);
wxUserAddLogQDTO.setExternalUserid(externalClerkRelated.getExternalUserId());
wxUserAddLogQDTO.setWxUserId(externalClerkRelated.getWxUserId());
wxUserAddLogQDTO.setStaffId(externalClerkRelated.getStaffId());
wxUserAddLogService.save(wxUserAddLogQDTO);
}
//日志
wxUserAddLogService.updateMemberInfo(wxEnterpriseId, enterpriseId, externalClerkRelated.getStaffId(), externalClerkRelated.getExternalUserId(), memberId);
}
/**
......
......@@ -441,7 +441,7 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@Override
public HmQrcodeDTO queryById(Long hmId) {
public HmQrcodeDTO getDetailById(Long hmId) {
HmQrcodeBO hmQrcodeBO = hmQrcodeService.queryById(hmId);
if (hmQrcodeBO != null) {
HmGroupSettingBO hmGroupSettingBO = hmGroupService.queryGroupSettingDetail(hmQrcodeBO.getHmGroupId());
......@@ -477,6 +477,11 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
return EntityUtil.changeEntityNew(HmQrcodeDTO.class, hmQrcodeBO);
}
@Override
public HmQrcodeDTO getSimpleById(Long hmId) {
return EntityUtil.changeEntityNew(HmQrcodeDTO.class, hmQrcodeService.queryById(hmId));
}
@GicLogRecord(value = "废弃员工活码-${#logContent}",
category = GicLogRecordCategoryEnum.HUOMA,
optType = GicLogRecordOptTypeEnum.HUOMA_DEL,
......@@ -658,4 +663,15 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
int updateCount = hmQrcodeService.batchUpdateQrcodeGroup(hmIds, groupId);
return ServiceResponse.success(updateCount > 0);
}
@Override
public HmClerkRelationDTO getHmClerkByHmIdAndClerkId(Long hmId, String clerkId) {
return EntityUtil.changeEntityNew(HmClerkRelationDTO.class,hmClerkRelationService.queryByHmIdAndClerkId(hmId, clerkId));
}
@Override
public HmClerkRelationDTO getOneHmClerkByHmId(Long hmId) {
HmClerkRelationBO hmClerkRelationBO = hmClerkRelationService.getHmClerkByHmId(hmId).get(0);
return EntityUtil.changeEntityNew(HmClerkRelationDTO.class,hmClerkRelationBO);
}
}
......@@ -181,7 +181,7 @@ public class HmQrcodeController {
*/
@RequestMapping(value = "detail", method = RequestMethod.GET)
public RestResponse detail(Long hmId) {
HmQrcodeDTO hmQrcodeDTO = this.hmQrcodeApiService.queryById(hmId);
HmQrcodeDTO hmQrcodeDTO = this.hmQrcodeApiService.getDetailById(hmId);
return RestResponse.successResult(hmQrcodeDTO);
}
......@@ -235,7 +235,7 @@ public class HmQrcodeController {
@RequestMapping(value = "detail-clerk-list", method = RequestMethod.POST)
public RestResponse detailClerkList(@RequestBody HmQrcodeDetailQO hmQrcodeDetailQO) {
Long hmId = hmQrcodeDetailQO.getHmId();
HmQrcodeDTO hmQrcodeDTO = hmQrcodeApiService.queryById(hmId);
HmQrcodeDTO hmQrcodeDTO = hmQrcodeApiService.getDetailById(hmId);
if (hmQrcodeDTO == null) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_8.getCode()),HaoBanErrCode.ERR_8.getMsg());
}
......@@ -267,7 +267,7 @@ public class HmQrcodeController {
public RestResponse detailClerkListPage(@RequestBody HmDetailClerkListQO hmDetailClerkListQO) {
hmDetailClerkListQO.getInFields().setEnterpriseId(AuthWebRequestUtil.getLoginUser().getEnterpriseId());
Long hmId = hmDetailClerkListQO.getInFields().getHmId();
HmQrcodeDTO hmQrcodeDTO = hmQrcodeApiService.queryById(hmId);
HmQrcodeDTO hmQrcodeDTO = hmQrcodeApiService.getDetailById(hmId);
if (hmQrcodeDTO == null) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_8.getCode()),HaoBanErrCode.ERR_8.getMsg());
}
......
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