|
|
@ -24,16 +24,16 @@ import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dao.SocietyOrgDao; |
|
|
|
import com.epmet.dao.IcSocietyOrgDao; |
|
|
|
import com.epmet.dto.form.AddSocietyOrgFormDTO; |
|
|
|
import com.epmet.dto.form.EditSocietyOrgFormDTO; |
|
|
|
import com.epmet.dto.form.GetListSocietyOrgFormDTO; |
|
|
|
import com.epmet.dto.form.UserIdsFormDTO; |
|
|
|
import com.epmet.dto.result.GetListSocietyOrgResultDTO; |
|
|
|
import com.epmet.dto.result.StaffSinGridResultDTO; |
|
|
|
import com.epmet.entity.SocietyOrgEntity; |
|
|
|
import com.epmet.entity.IcSocietyOrgEntity; |
|
|
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
|
|
|
import com.epmet.service.SocietyOrgService; |
|
|
|
import com.epmet.service.IcSocietyOrgService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import org.slf4j.Logger; |
|
|
@ -53,8 +53,8 @@ import java.util.stream.Collectors; |
|
|
|
* @since v1.0.0 2021-11-18 |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class SocietyOrgServiceImpl extends BaseServiceImpl<SocietyOrgDao, SocietyOrgEntity> implements SocietyOrgService { |
|
|
|
private static final Logger log = LoggerFactory.getLogger(SocietyOrgServiceImpl.class); |
|
|
|
public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, IcSocietyOrgEntity> implements IcSocietyOrgService { |
|
|
|
private static final Logger log = LoggerFactory.getLogger(IcSocietyOrgServiceImpl.class); |
|
|
|
@Autowired |
|
|
|
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|
|
|
|
|
|
@ -66,7 +66,7 @@ public class SocietyOrgServiceImpl extends BaseServiceImpl<SocietyOrgDao, Societ |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void add(AddSocietyOrgFormDTO dto) { |
|
|
|
SocietyOrgEntity entity = ConvertUtils.sourceToTarget(dto, SocietyOrgEntity.class); |
|
|
|
IcSocietyOrgEntity entity = ConvertUtils.sourceToTarget(dto, IcSocietyOrgEntity.class); |
|
|
|
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(dto.getCustomerId(), dto.getStaffId()); |
|
|
|
entity.setAgencyId(staffInfoCache.getAgencyId()); |
|
|
|
entity.setPids(staffInfoCache.getAgencyPIds()); |
|
|
@ -79,11 +79,11 @@ public class SocietyOrgServiceImpl extends BaseServiceImpl<SocietyOrgDao, Societ |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public void edit(EditSocietyOrgFormDTO formDTO) { |
|
|
|
SocietyOrgEntity entity = baseDao.selectById(formDTO.getSocietyId()); |
|
|
|
IcSocietyOrgEntity entity = baseDao.selectById(formDTO.getSocietyId()); |
|
|
|
if (null == entity) { |
|
|
|
throw new RenException(String.format("修改社会组织信息失败,社会组织信息不存在,组织Id->%s", formDTO.getSocietyId())); |
|
|
|
} |
|
|
|
entity = ConvertUtils.sourceToTarget(formDTO, SocietyOrgEntity.class); |
|
|
|
entity = ConvertUtils.sourceToTarget(formDTO, IcSocietyOrgEntity.class); |
|
|
|
baseDao.updateById(entity); |
|
|
|
} |
|
|
|
|