|
@@ -1,6 +1,7 @@
|
|
|
package com.jtzx.crm.module.sys.service;
|
|
package com.jtzx.crm.module.sys.service;
|
|
|
|
|
|
|
|
import cc.uncarbon.framework.core.context.UserContextHolder;
|
|
import cc.uncarbon.framework.core.context.UserContextHolder;
|
|
|
|
|
+import cc.uncarbon.framework.core.exception.BusinessException;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
@@ -61,7 +62,7 @@ public class SysCustomerFollowService {
|
|
|
* 后台管理-新增
|
|
* 后台管理-新增
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void adminInsert(AdminSysCustomerFollowInsertOrUpdateDTO dto) {
|
|
|
|
|
|
|
+ public void adminInsert(AdminSysCustomerFollowInsertOrUpdateDTO dto) throws BusinessException {
|
|
|
log.info("[后台管理-客户跟进数据信息-新增] >> DTO={}", dto);
|
|
log.info("[后台管理-客户跟进数据信息-新增] >> DTO={}", dto);
|
|
|
permissionService.publicPrivateCustomerPermission();
|
|
permissionService.publicPrivateCustomerPermission();
|
|
|
dto.setId(null);
|
|
dto.setId(null);
|
|
@@ -100,7 +101,7 @@ public class SysCustomerFollowService {
|
|
|
/**
|
|
/**
|
|
|
* 我的客户页面,预约待办列表去消预约操作
|
|
* 我的客户页面,预约待办列表去消预约操作
|
|
|
*/
|
|
*/
|
|
|
- public void cancelOrder(CannelOrderDTO dto,Boolean privateStatus) {
|
|
|
|
|
|
|
+ public void cancelOrder(CannelOrderDTO dto, Boolean privateStatus) {
|
|
|
if (privateStatus) {
|
|
if (privateStatus) {
|
|
|
permissionService.publicPrivateCustomerPermission();
|
|
permissionService.publicPrivateCustomerPermission();
|
|
|
}
|
|
}
|
|
@@ -237,7 +238,7 @@ public class SysCustomerFollowService {
|
|
|
sysCustomerFollowMapper.selectList(
|
|
sysCustomerFollowMapper.selectList(
|
|
|
new LambdaQueryWrapper<>(SysCustomerFollowEntity.class)
|
|
new LambdaQueryWrapper<>(SysCustomerFollowEntity.class)
|
|
|
.eq(SysCustomerFollowEntity::getCustomerId, customerId)
|
|
.eq(SysCustomerFollowEntity::getCustomerId, customerId)
|
|
|
- .eq(userId!=null,SysCustomerFollowEntity::getClaimUserId, userId)
|
|
|
|
|
|
|
+ .eq(userId != null, SysCustomerFollowEntity::getClaimUserId, userId)
|
|
|
);
|
|
);
|
|
|
if (CollUtil.isNotEmpty(followEntityList)) {
|
|
if (CollUtil.isNotEmpty(followEntityList)) {
|
|
|
List<Long> productIdList = followEntityList.stream()
|
|
List<Long> productIdList = followEntityList.stream()
|
|
@@ -296,7 +297,7 @@ public class SysCustomerFollowService {
|
|
|
sysCustomerFollowMapper.selectList(
|
|
sysCustomerFollowMapper.selectList(
|
|
|
new LambdaQueryWrapper<>(SysCustomerFollowEntity.class)
|
|
new LambdaQueryWrapper<>(SysCustomerFollowEntity.class)
|
|
|
.eq(SysCustomerFollowEntity::getCustomerId, customerId)
|
|
.eq(SysCustomerFollowEntity::getCustomerId, customerId)
|
|
|
- .eq(userId!=null,SysCustomerFollowEntity::getClaimUserId, userId)
|
|
|
|
|
|
|
+ .eq(userId != null, SysCustomerFollowEntity::getClaimUserId, userId)
|
|
|
.eq(SysCustomerFollowEntity::getOrderStatus, 0)//待开始的
|
|
.eq(SysCustomerFollowEntity::getOrderStatus, 0)//待开始的
|
|
|
.isNotNull(SysCustomerFollowEntity::getOrderType)//预约待办不能为空的
|
|
.isNotNull(SysCustomerFollowEntity::getOrderType)//预约待办不能为空的
|
|
|
.orderByDesc(SysCustomerFollowEntity::getCreatedAt)
|
|
.orderByDesc(SysCustomerFollowEntity::getCreatedAt)
|
|
@@ -319,7 +320,7 @@ public class SysCustomerFollowService {
|
|
|
* @param dto
|
|
* @param dto
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void handleParams(AdminSysCustomerFollowInsertOrUpdateDTO dto) {
|
|
|
|
|
|
|
+ public void handleParams(AdminSysCustomerFollowInsertOrUpdateDTO dto) throws BusinessException{
|
|
|
//处理联系人
|
|
//处理联系人
|
|
|
SysCustomerPersonEntity sysCustomerPersonEntity = sysCustomerPersonMapper.selectOne(
|
|
SysCustomerPersonEntity sysCustomerPersonEntity = sysCustomerPersonMapper.selectOne(
|
|
|
new LambdaQueryWrapper<SysCustomerPersonEntity>()
|
|
new LambdaQueryWrapper<SysCustomerPersonEntity>()
|
|
@@ -424,7 +425,7 @@ public class SysCustomerFollowService {
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void addFollowAuditData(AdminSysCustomerFollowInsertOrUpdateDTO dto) {
|
|
|
|
|
|
|
+ public void addFollowAuditData(AdminSysCustomerFollowInsertOrUpdateDTO dto) throws BusinessException{
|
|
|
//先查询管理员数据
|
|
//先查询管理员数据
|
|
|
List<SysUserRoleRelationEntity> adminUserList =
|
|
List<SysUserRoleRelationEntity> adminUserList =
|
|
|
sysUserRoleRelationMapper.selectList(
|
|
sysUserRoleRelationMapper.selectList(
|
|
@@ -448,7 +449,7 @@ public class SysCustomerFollowService {
|
|
|
throw new RuntimeException("参数错误,管理员不存在");
|
|
throw new RuntimeException("参数错误,管理员不存在");
|
|
|
}
|
|
}
|
|
|
adminUserList.forEach(adminUser -> {
|
|
adminUserList.forEach(adminUser -> {
|
|
|
- SysCustomerFollowAuditEntity entity =this.getFollowAuditEntity(dto);
|
|
|
|
|
|
|
+ SysCustomerFollowAuditEntity entity = this.getFollowAuditEntity(dto);
|
|
|
entity.setAuditUserId(adminUser.getUserId()); // 设置审核人id
|
|
entity.setAuditUserId(adminUser.getUserId()); // 设置审核人id
|
|
|
sysUserEntities.stream()
|
|
sysUserEntities.stream()
|
|
|
.filter(x -> x.getId().equals(adminUser.getUserId()))
|
|
.filter(x -> x.getId().equals(adminUser.getUserId()))
|
|
@@ -491,7 +492,7 @@ public class SysCustomerFollowService {
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void checkParam(AdminSysCustomerFollowInsertOrUpdateDTO dto) {
|
|
|
|
|
|
|
+ public void checkParam(AdminSysCustomerFollowInsertOrUpdateDTO dto) throws BusinessException {
|
|
|
|
|
|
|
|
if (dto.getCustomerId() == null) {
|
|
if (dto.getCustomerId() == null) {
|
|
|
throw new RuntimeException("参数错误,客户不能为空");
|
|
throw new RuntimeException("参数错误,客户不能为空");
|