|
@ -61,6 +61,8 @@ import com.epmet.service.GovStaffRoleService; |
|
|
import com.epmet.service.StaffRoleService; |
|
|
import com.epmet.service.StaffRoleService; |
|
|
import com.epmet.service.UserService; |
|
|
import com.epmet.service.UserService; |
|
|
import com.epmet.util.ModuleConstant; |
|
|
import com.epmet.util.ModuleConstant; |
|
|
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.logging.log4j.LogManager; |
|
|
import org.apache.logging.log4j.LogManager; |
|
@ -301,6 +303,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
resultDTO.setMobile(customerStaffDTO.getMobile()); |
|
|
resultDTO.setMobile(customerStaffDTO.getMobile()); |
|
|
resultDTO.setWorkType(customerStaffDTO.getWorkType()); |
|
|
resultDTO.setWorkType(customerStaffDTO.getWorkType()); |
|
|
resultDTO.setIdCard(customerStaffDTO.getIdCard()); |
|
|
resultDTO.setIdCard(customerStaffDTO.getIdCard()); |
|
|
|
|
|
resultDTO.setCustomerId(customerStaffDTO.getCustomerId()); |
|
|
//获取角色列表
|
|
|
//获取角色列表
|
|
|
GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); |
|
|
GovStaffRoleDTO govStaffRoleDTO = new GovStaffRoleDTO(); |
|
|
govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); |
|
|
govStaffRoleDTO.setCustomerId(fromDTO.getCustomerId()); |
|
@ -347,7 +350,8 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
customerStaffFormDTO.setMobile(fromDTO.getMobile()); |
|
|
customerStaffFormDTO.setMobile(fromDTO.getMobile()); |
|
|
CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); |
|
|
CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); |
|
|
if (null != customerStaffDTO) { |
|
|
if (null != customerStaffDTO) { |
|
|
return new Result<CustomerStaffDTO>().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); |
|
|
// return new Result<CustomerStaffDTO>().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg());
|
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"手机号已存在","手机号已存在"); |
|
|
} |
|
|
} |
|
|
//USER表插入数据
|
|
|
//USER表插入数据
|
|
|
UserEntity userEntity = new UserEntity(); |
|
|
UserEntity userEntity = new UserEntity(); |
|
@ -467,12 +471,14 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
customerStaffFormDTO.setMobile(fromDTO.getMobile()); |
|
|
customerStaffFormDTO.setMobile(fromDTO.getMobile()); |
|
|
CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); |
|
|
CustomerStaffDTO customerStaffDTO = baseDao.selectListCustomerStaffInfo(customerStaffFormDTO); |
|
|
if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) { |
|
|
if (null != customerStaffDTO && !fromDTO.getStaffId().equals(customerStaffDTO.getUserId())) { |
|
|
return new Result<CustomerStaffDTO>().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg()); |
|
|
// return new Result<CustomerStaffDTO>().error(EpmetErrorCode.MOBILE_USED.getCode(), EpmetErrorCode.MOBILE_USED.getMsg());
|
|
|
|
|
|
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"手机号已存在","手机号已存在"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); |
|
|
CustomerStaffEntity customerStaffEntity = baseDao.selectByUserId(fromDTO.getStaffId()); |
|
|
//Customer_Staff表插入数据
|
|
|
//Customer_Staff表插入数据
|
|
|
CustomerStaffEntity staffEntity = new CustomerStaffEntity(); |
|
|
CustomerStaffEntity staffEntity = new CustomerStaffEntity(); |
|
|
|
|
|
staffEntity.setCustomerId(customerStaffEntity.getCustomerId()); |
|
|
staffEntity.setId(customerStaffEntity.getId()); |
|
|
staffEntity.setId(customerStaffEntity.getId()); |
|
|
staffEntity.setRealName(fromDTO.getName()); |
|
|
staffEntity.setRealName(fromDTO.getName()); |
|
|
staffEntity.setMobile(fromDTO.getMobile()); |
|
|
staffEntity.setMobile(fromDTO.getMobile()); |
|
@ -491,6 +497,7 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
staffRoleEntity.setStaffId(fromDTO.getStaffId()); |
|
|
staffRoleEntity.setStaffId(fromDTO.getStaffId()); |
|
|
staffRoleEntity.setRoleId(role); |
|
|
staffRoleEntity.setRoleId(role); |
|
|
staffRoleEntity.setOrgId(fromDTO.getAgencyId()); |
|
|
staffRoleEntity.setOrgId(fromDTO.getAgencyId()); |
|
|
|
|
|
staffRoleEntity.setCustomerId(customerStaffEntity.getCustomerId()); |
|
|
staffRoleService.insert(staffRoleEntity); |
|
|
staffRoleService.insert(staffRoleEntity); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -1159,10 +1166,10 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao, |
|
|
Integer no = NumConstant.ONE; |
|
|
Integer no = NumConstant.ONE; |
|
|
Integer size; |
|
|
Integer size; |
|
|
do { |
|
|
do { |
|
|
List<CustomerStaffDTO> customerStaffs = baseDao.getAllStaffByCustomerId(customerId); |
|
|
PageInfo<CustomerStaffDTO> pageInfo = PageHelper.startPage(no, NumConstant.ONE_HUNDRED).doSelectPageInfo(() -> baseDao.getAllStaffByCustomerId(customerId)); |
|
|
size = customerStaffs.size(); |
|
|
size = pageInfo.getList().size(); |
|
|
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(customerStaffs)){ |
|
|
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(pageInfo.getList())){ |
|
|
customerStaffs.forEach(c -> { |
|
|
pageInfo.getList().forEach(c -> { |
|
|
String key = RedisKeys.getCustomerStaffInfoKeyByMobile(customerId, c.getMobile()); |
|
|
String key = RedisKeys.getCustomerStaffInfoKeyByMobile(customerId, c.getMobile()); |
|
|
Map<String, Object> map = BeanUtil.beanToMap(c, false, true); |
|
|
Map<String, Object> map = BeanUtil.beanToMap(c, false, true); |
|
|
redisUtils.hMSet(key,map); |
|
|
redisUtils.hMSet(key,map); |
|
|