|
|
@@ -127,8 +127,8 @@ public class SysCustomerPersonService {
|
|
|
throw new BusinessException(400, "无效客户(学校)数据ID");
|
|
|
}
|
|
|
SysCustomerPersonEntity sysCustomerPersonEntity = sysCustomerPersonMapper.selectById(dto.getId());
|
|
|
- if (!UserContextHolder.getUserContext().getRoles().contains("Admin") ||
|
|
|
- sysCustomerPersonEntity.getOperUserId().equals(UserContextHolder.getUserId())) {
|
|
|
+ if (!UserContextHolder.getUserContext().getRoles().contains("Admin") &&
|
|
|
+ !sysCustomerPersonEntity.getOperUserId().equals(UserContextHolder.getUserId())) {
|
|
|
throw new BusinessException(400, "无权操作");
|
|
|
}
|
|
|
//查询用户的小组数据
|
|
|
@@ -144,24 +144,28 @@ public class SysCustomerPersonService {
|
|
|
.last("limit 1")
|
|
|
);
|
|
|
|
|
|
- SysCustomerOperLogEntity logEntity = SysCustomerOperLogEntity.builder()
|
|
|
- .customerId(entity.getId())
|
|
|
- .customerName(entity.getName())
|
|
|
- .operUserId(UserContextHolder.getUserId())
|
|
|
- .operName(UserContextHolder.getUserName())
|
|
|
- .operAction(12)
|
|
|
- .operDatetime(LocalDateTime.now())
|
|
|
- .provinceId(entity.getProvinceId())
|
|
|
- .provinceName(entity.getProvinceName())
|
|
|
- .cityId(entity.getCityId())
|
|
|
- .cityName(entity.getCityName())
|
|
|
- .content(sysCustomerPersonEntity.compareTo(dto))
|
|
|
- .operDataType(1)
|
|
|
- .build();
|
|
|
- if (userGroupRelation != null) {
|
|
|
- logEntity.setOperUserGroupId(userGroupRelation.getGroupId());
|
|
|
+ String string = sysCustomerPersonEntity.compareTo(dto);
|
|
|
+ if(StrUtil.isNotEmpty(string)){
|
|
|
+ SysCustomerOperLogEntity logEntity = SysCustomerOperLogEntity.builder()
|
|
|
+ .customerId(entity.getId())
|
|
|
+ .customerName(entity.getName())
|
|
|
+ .operUserId(UserContextHolder.getUserId())
|
|
|
+ .operName(UserContextHolder.getUserName())
|
|
|
+ .operAction(12)
|
|
|
+ .operDatetime(LocalDateTime.now())
|
|
|
+ .provinceId(entity.getProvinceId())
|
|
|
+ .provinceName(entity.getProvinceName())
|
|
|
+ .cityId(entity.getCityId())
|
|
|
+ .cityName(entity.getCityName())
|
|
|
+ .content(string)
|
|
|
+ .operDataType(1)
|
|
|
+ .build();
|
|
|
+ if (userGroupRelation != null) {
|
|
|
+ logEntity.setOperUserGroupId(userGroupRelation.getGroupId());
|
|
|
+ }
|
|
|
+ sysCustomerOperLogMapper.insert(logEntity);
|
|
|
}
|
|
|
- sysCustomerOperLogMapper.insert(logEntity);
|
|
|
+
|
|
|
|
|
|
BeanUtil.copyProperties(dto, sysCustomerPersonEntity);
|
|
|
sysCustomerPersonMapper.updateById(sysCustomerPersonEntity);
|
|
|
@@ -177,8 +181,8 @@ public class SysCustomerPersonService {
|
|
|
if (sysCustomerPersonEntity == null) {
|
|
|
throw new BusinessException(400, "联系人不存在");
|
|
|
}
|
|
|
- if (!UserContextHolder.getUserContext().getRoles().contains("Admin") ||
|
|
|
- sysCustomerPersonEntity.getOperUserId().equals(UserContextHolder.getUserId())) {
|
|
|
+ if (!UserContextHolder.getUserContext().getRoles().contains("Admin") &&
|
|
|
+ !sysCustomerPersonEntity.getOperUserId().equals(UserContextHolder.getUserId())) {
|
|
|
throw new BusinessException(400, "无权操作");
|
|
|
}
|
|
|
|