Merge remote-tracking branch 'origin/cc_20230520_partner' into cc_20230520_partner

This commit is contained in:
俞扬
2023-07-02 21:15:40 +08:00
6 changed files with 25 additions and 8 deletions

View File

@@ -161,8 +161,14 @@
</if>
</trim>
ON DUPLICATE KEY UPDATE user_id = values(user_id), name = values(name), remark = values(remark), mobile = values(mobile), email = values(email), org_email = values(org_email)
, main_admin = values(main_admin), is_admin = values(is_admin), unionid = values(unionid), avatar = values(avatar), jobnumber = values(jobnumber), is_leader = values(is_leader)
, leader_dept_ids = values(leader_dept_ids), face_url = values(face_url), user_status = values(user_status), user_region_ids = values(user_region_ids), deleted = values(deleted)
, main_admin = values(main_admin), is_admin = values(is_admin), unionid = values(unionid), avatar = values(avatar), jobnumber = values(jobnumber)
, face_url = values(face_url), user_status = values(user_status), user_region_ids = values(user_region_ids), deleted = values(deleted)
<if test="record.isLeader != null">
, is_leader = values(is_leader)
</if>
<if test="record.leaderDeptIds != null">
, leader_dept_ids = values(leader_dept_ids)
</if>
</foreach>
</insert>
<update id="updateByPrimaryKeySelective">

View File

@@ -2,6 +2,7 @@ package com.cool.store.dto.enterprise;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.enums.FSEventTypeEnum;
import com.cool.store.enums.UserStatusEnum;
import com.cool.store.utils.UUIDUtils;
import com.google.common.collect.Lists;
@@ -142,7 +143,7 @@ public class EnterpriseUserDTO implements Serializable {
}
public static EnterpriseUserDO transUserDtoToDo(EnterpriseUserDTO user, Map<String, String> regionPathMap, Multimap<String, String> leaderDeptMap) {
public static EnterpriseUserDO transUserDtoToDo(EnterpriseUserDTO user, Map<String, String> regionPathMap, Multimap<String, String> leaderDeptMap, FSEventTypeEnum eventType) {
EnterpriseUserDO enterpriseUserDO = new EnterpriseUserDO();
enterpriseUserDO.setId(UUIDUtils.get32UUID());
enterpriseUserDO.setUserId(user.getUserId());
@@ -157,7 +158,6 @@ public class EnterpriseUserDTO implements Serializable {
enterpriseUserDO.setAvatar(user.getAvatar());
enterpriseUserDO.setJobnumber(user.getJobnumber());
enterpriseUserDO.setUserStatus(UserStatusEnum.NORMAL.getCode());
enterpriseUserDO.setIsLeader(Boolean.FALSE);
List<String> departmentLists = user.getDepartmentLists();
List<String> regionPaths = new ArrayList<>();
if(CollectionUtils.isNotEmpty(departmentLists)){
@@ -165,6 +165,10 @@ public class EnterpriseUserDTO implements Serializable {
regionPaths.add(regionPathMap.get(departmentId));
}
}
//创建的时候给个默认值
if(FSEventTypeEnum.USER_CREATED.equals(eventType)){
enterpriseUserDO.setIsLeader(Boolean.FALSE);
}
Collection<String> deptIds = leaderDeptMap.get(user.getUserId());
if(CollectionUtils.isNotEmpty(deptIds)){
enterpriseUserDO.setIsLeader(Boolean.TRUE);

View File

@@ -132,7 +132,7 @@ public class EcSyncServiceImpl implements EcSyncService {
String followUserName = customerInfoItem.getFollowUserName();
String followUserMobile = customerInfoItem.getFollowUserMobile();
//传递过来有跟进人的情况下查询跟进人是否存在
if (StringUtil.isNotEmpty(followUserMobile)&&StringUtil.isNotEmpty(followUserMobile)) {
if (StringUtil.isNotEmpty(followUserMobile)&&StringUtil.isNotEmpty(followUserName)) {
String userId = enterpriseUserDAO.selectByMobile("+86"+followUserMobile);
if (StringUtil.isEmpty(userId)) {
// 给飞书群发送消息 跟进人找不到

View File

@@ -11,6 +11,7 @@ import com.cool.store.dto.enterprise.*;
import com.cool.store.entity.*;
import com.cool.store.enums.DataSourceEnum;
import com.cool.store.enums.ErrorCodeEnum;
import com.cool.store.enums.FSEventTypeEnum;
import com.cool.store.exception.ServiceException;
import com.cool.store.http.ISVHttpRequest;
import com.cool.store.service.EnterpriseSyncService;
@@ -168,7 +169,8 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
@Override
public void userUpdateEvent(UserEventDTO param) {
switch (parseValue(param.getEventType())){
FSEventTypeEnum eventType = parseValue(param.getEventType());
switch (eventType){
case USER_CREATED:
case USER_UPDATED:
EnterpriseUserDTO userDetail = isvHttpRequest.getUserDetailByUserId(param.getOpenId());
@@ -202,7 +204,7 @@ public class EnterpriseSyncServiceImpl implements EnterpriseSyncService {
}else{
enterpriseUserRoleDAO.deleteUserRole(userDetail.getUserId());
}
EnterpriseUserDO enterpriseUser = EnterpriseUserDTO.transUserDtoToDo(userDetail, regionPathMap, leaderDeptMap);
EnterpriseUserDO enterpriseUser = EnterpriseUserDTO.transUserDtoToDo(userDetail, regionPathMap, leaderDeptMap, eventType);
enterpriseUserDAO.batchInsertOrUpdate(new ArrayList<>(Arrays.asList(enterpriseUser)));
break;
case USER_DELETED:

View File

@@ -267,9 +267,12 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
@Override
public PartnerIntentInfoVO queryPartnerIntentInfo(PartnerUserInfoVO userInfoVO, Long lineId) {
log.info("HyPartnerClerkServiceImpl#queryPartnerIntentInfo userInfoVO:{}", JSONObject.toJSONString(userInfoVO));
String cacheKey = MessageFormat.format(RedisConstant.PARTNER_INTENTINFO_CACHE_KEY, userInfoVO.getPartnerId(), lineId);
if (StringUtils.isNotBlank(redisUtilPool.getString(cacheKey))) {
PartnerIntentInfoVO intentInfoVO = JSONObject.parseObject(redisUtilPool.getString(cacheKey), PartnerIntentInfoVO.class);
intentInfoVO.setWantShopAreaName(userInfoVO.getWantShopAreaName());
return intentInfoVO;
}
HyPartnerIntentInfoDO intentInfoDO = hyPartnerIntentInfoDAO.getByPartnerIdAndLineId(userInfoVO.getPartnerId(), lineId);
@@ -289,6 +292,8 @@ public class HyPartnerIntentInfoServiceImpl implements HyPartnerIntentInfoServic
intentInfoVO.setAcceptAdjustType(userInfoVO.getAcceptAdjustType());
}
intentInfoVO.setWantShopAreaName(userInfoVO.getWantShopAreaName());
log.info("HyPartnerClerkServiceImpl#queryPartnerIntentInfo intentInfoVO:{}", JSONObject.toJSONString(intentInfoVO));
return intentInfoVO;
}

View File

@@ -24,7 +24,7 @@ public class EnterpriseUserController {
@ApiOperation("获取开发主管")
@GetMapping("/getDevelopmentDirectorList")
public ResponseResult getDevelopmentDirectorList(@RequestParam("wantShopArea") String wantShopArea){
public ResponseResult getDevelopmentDirectorList(@RequestParam(value = "wantShopArea",required = false) String wantShopArea){
return ResponseResult.success(enterpriseUserService.getDevelopmentDirectorList(wantShopArea));
}