========

1 parent a541fbf5
......@@ -98,15 +98,15 @@ public class WeCustomerController extends BaseController
// return util.exportExcel(list, "customer");
// }
/**
* 获取企业微信客户详细信息
*/
// @PreAuthorize("@ss.hasPermi('customerManage:customer:view')")
@GetMapping(value = "/{externalUserId}")
public AjaxResult getInfo(@PathVariable("externalUserId") String externalUserId)
{
return AjaxResult.success(weCustomerService.selectWeCustomerById(externalUserId));
}
// /**
// * 获取企业微信客户详细信息
// */
// // @PreAuthorize("@ss.hasPermi('customerManage:customer:view')")
// @GetMapping(value = "/{externalUserId}")
// public AjaxResult getInfo(@PathVariable("externalUserId") String externalUserId)
// {
// return AjaxResult.success(weCustomerService.selectWeCustomerById(externalUserId));
// }
......
......@@ -27,7 +27,7 @@ public interface IWeCustomerService extends IService<WeCustomer>
* @param externalUserId 企业微信客户ID
* @return 企业微信客户
*/
public WeCustomer selectWeCustomerById(String externalUserId);
public WeCustomer selectWeCustomerById(String externalUserId,String userId);
// /**
// * 新增/修改企业微信客户
......
......@@ -83,11 +83,12 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
* 查询企业微信客户
*
* @param externalUserId 企业微信客户ID
* @param userId 企业员工id
* @return 企业微信客户
*/
@Override
public WeCustomer selectWeCustomerById(String externalUserId) {
return this.baseMapper.selectWeCustomerById(externalUserId);
public WeCustomer selectWeCustomerById(String externalUserId,String userId) {
return this.baseMapper.selectWeCustomerById(externalUserId,userId);
}
/**
......
......@@ -6,19 +6,14 @@ import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.wecom.domain.WeCustomer;
import com.linkwechat.wecom.domain.WeFlowerCustomerRel;
import com.linkwechat.wecom.domain.WeFlowerCustomerTagRel;
import com.linkwechat.wecom.mapper.WeCustomerMapper;
import com.linkwechat.wecom.mapper.WeCustomerTagRelMapper;
import com.linkwechat.wecom.mapper.WeFlowerCustomerRelMapper;
import com.linkwechat.wecom.mapper.WeFlowerCustomerTagRelMapper;
import com.linkwechat.wecom.service.IWeCustomerService;
import com.linkwechat.wecom.service.IWeCustomerTagRelService;
import com.linkwechat.wecom.service.IWeFlowerCustomerRelService;
import com.linkwechat.wecom.service.IWeFlowerCustomerTagRelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Collectors;
......
......@@ -72,6 +72,7 @@ public class WeSensitiveActHitServiceImpl extends ServiceImpl<WeSensitiveActHitM
String operatorTargetId = chatJson.getString("tolist");
weSensitiveActHit.setOperatorId(operatorId);
weSensitiveActHit.setOperateTargetId(operatorTargetId);
setUserOrCustomerInfo(weSensitiveActHit);
saveOrUpdate(weSensitiveActHit);
}
......@@ -102,6 +103,7 @@ public class WeSensitiveActHitServiceImpl extends ServiceImpl<WeSensitiveActHitM
}
private void setUserOrCustomerInfo(WeSensitiveActHit weSensitiveActHit) {
int operatorType = StringUtils.weCustomTypeJudgment(weSensitiveActHit.getOperatorId());
int operatorTargetType = StringUtils.weCustomTypeJudgment(weSensitiveActHit.getOperateTargetId());
weSensitiveActHit.setOperator(getUserOrCustomerName(operatorType, weSensitiveActHit.getOperatorId()));
......@@ -118,10 +120,15 @@ public class WeSensitiveActHitServiceImpl extends ServiceImpl<WeSensitiveActHitM
}
} else if (WeConstans.ID_TYPE_EX.equals(type)) {
//获取外部联系人信息
WeCustomer weCustomer = weCustomerMapper.selectWeCustomerById(userId);
if (weCustomer != null) {
return weCustomer.getName();
// WeCustomer weCustomer = weCustomerMapper.selectWeCustomerById(userId);
List<WeCustomer> weCustomers = weCustomerMapper.selectList(new LambdaQueryWrapper<WeCustomer>()
.eq(WeCustomer::getExternalUserid, userId));
if(CollectionUtils.isNotEmpty(weCustomers)){
return weCustomers.stream().findFirst().get().getName();
}
} else if (WeConstans.ID_TYPE_MACHINE.equals(type)) {
//拉去机器人信息暂不处理
}
......
......@@ -301,8 +301,12 @@ public class WeTaskFissionServiceImpl extends ServiceImpl<WeTaskFissionMapper, W
List<WeTaskFissionRecord> weTaskFissionRecords = weTaskFissionRecordService.list(new LambdaQueryWrapper<WeTaskFissionRecord>().eq(WeTaskFissionRecord::getTaskFissionId, fissionId));
if(CollectionUtil.isNotEmpty(weTaskFissionRecords)){
weTaskFissionRecords.forEach(record -> {
WeCustomer weCustomer = weCustomerService.selectWeCustomerById(record.getCustomerId());
customerList.add(weCustomer);
// WeCustomer weCustomer = weCustomerService.selectWeCustomerById(record.getCustomerId());
// customerList.add(weCustomer);
customerList.addAll(
weCustomerService.list(new LambdaQueryWrapper<WeCustomer>()
.eq(WeCustomer::getExternalUserid,record.getCustomerId()))
);
});
}
} else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!