|
@ -48,7 +48,9 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.util.CollectionUtils; |
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.HashMap; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
|
|
|
import java.util.Map; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -74,6 +76,14 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void add(AddPlacePatrolTeamFormDTO formDTO) { |
|
|
public void add(AddPlacePatrolTeamFormDTO formDTO) { |
|
|
|
|
|
//检验分队下添加的人员手机号唯一
|
|
|
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
|
|
formDTO.getMemberList().forEach(m -> { |
|
|
|
|
|
if(map.containsKey(m.getMobile())){ |
|
|
|
|
|
throw new RenException(String.format("新增巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile())); |
|
|
|
|
|
} |
|
|
|
|
|
map.put(m.getMobile(),m.getName()); |
|
|
|
|
|
}); |
|
|
//1.分队主表新增数据
|
|
|
//1.分队主表新增数据
|
|
|
IcPlacePatrolTeamEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class); |
|
|
IcPlacePatrolTeamEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class); |
|
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); |
|
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); |
|
@ -101,6 +111,14 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT |
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void edit(EditPlacePatrolTeamFormDTO formDTO) { |
|
|
public void edit(EditPlacePatrolTeamFormDTO formDTO) { |
|
|
|
|
|
//检验分队下添加的人员手机号唯一
|
|
|
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
|
|
formDTO.getMemberList().forEach(m -> { |
|
|
|
|
|
if(map.containsKey(m.getMobile())){ |
|
|
|
|
|
throw new RenException(String.format("修改巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile())); |
|
|
|
|
|
} |
|
|
|
|
|
map.put(m.getMobile(),m.getName()); |
|
|
|
|
|
}); |
|
|
//1.修改分队主表信息
|
|
|
//1.修改分队主表信息
|
|
|
IcPlacePatrolTeamEntity entity = baseDao.selectById(formDTO.getTeamId()); |
|
|
IcPlacePatrolTeamEntity entity = baseDao.selectById(formDTO.getTeamId()); |
|
|
if (null == entity) { |
|
|
if (null == entity) { |
|
|