|
|
@ -23,9 +23,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.modules.partymember.dao.IcPartymemberStyleDao; |
|
|
|
import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity; |
|
|
@ -94,8 +97,11 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void save(IcPartymemberStyleDTO dto) { |
|
|
|
public void save(TokenDto tokenDto, IcPartymemberStyleDTO dto) { |
|
|
|
IcPartymemberStyleEntity entity = ConvertUtils.sourceToTarget(dto, IcPartymemberStyleEntity.class); |
|
|
|
entity.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
|
entity.setAgencyId(staff.getAgencyId()); |
|
|
|
if (StringUtils.isBlank(entity.getId())) { |
|
|
|
insert(entity); |
|
|
|
} else { |
|
|
@ -108,6 +114,7 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember |
|
|
|
AtomicInteger i = new AtomicInteger(NumConstant.ZERO); |
|
|
|
List<IcPartymemberStyleImageEntity> list = dto.getImageList().stream().map(item -> { |
|
|
|
IcPartymemberStyleImageEntity e = new IcPartymemberStyleImageEntity(); |
|
|
|
e.setCustomerId(tokenDto.getCustomerId()); |
|
|
|
e.setStyleId(entity.getId()); |
|
|
|
e.setImageUrl(item); |
|
|
|
e.setSort(i.getAndIncrement()); |
|
|
|