|
@ -2,24 +2,27 @@ package com.epmet.service.impl; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.dao.ThirdplatformCustomerActionDao; |
|
|
import com.epmet.dao.ThirdplatformCustomerActionDao; |
|
|
import com.epmet.dao.ThirdplatformCustomerRegisterDao; |
|
|
import com.epmet.dao.ThirdplatformCustomerRegisterDao; |
|
|
import com.epmet.dao.ThirdplatformDao; |
|
|
import com.epmet.dao.ThirdplatformDao; |
|
|
|
|
|
import com.epmet.dto.ThirdPlatformDTO; |
|
|
|
|
|
import com.epmet.dto.form.CustomerFormDTO; |
|
|
import com.epmet.dto.form.ThirdPlatformFormDTO; |
|
|
import com.epmet.dto.form.ThirdPlatformFormDTO; |
|
|
|
|
|
import com.epmet.dto.form.PlatformRegisterFormDTO; |
|
|
|
|
|
import com.epmet.dto.form.PlatformUnregisterFormDTO; |
|
|
import com.epmet.dto.result.ThirdplatformResultDTO; |
|
|
import com.epmet.dto.result.ThirdplatformResultDTO; |
|
|
import com.epmet.entity.ThirdplatformActionEntity; |
|
|
|
|
|
import com.epmet.entity.ThirdplatformCustomerActionEntity; |
|
|
import com.epmet.entity.ThirdplatformCustomerActionEntity; |
|
|
import com.epmet.entity.ThirdplatformCustomerRegisterEntity; |
|
|
import com.epmet.entity.ThirdplatformCustomerRegisterEntity; |
|
|
|
|
|
import com.epmet.entity.ThirdplatformEntity; |
|
|
import com.epmet.service.ThirdPlatformService; |
|
|
import com.epmet.service.ThirdPlatformService; |
|
|
import jodd.util.CollectionUtil; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.constraints.NotBlank; |
|
|
import java.util.ArrayList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
public class ThirdPlatformServiceImpl implements ThirdPlatformService { |
|
|
public class ThirdPlatformServiceImpl implements ThirdPlatformService { |
|
@ -105,4 +108,56 @@ public class ThirdPlatformServiceImpl implements ThirdPlatformService { |
|
|
entity.setCustomizedPlatformIcon(platformFormDTO.getIcon()); |
|
|
entity.setCustomizedPlatformIcon(platformFormDTO.getIcon()); |
|
|
thirdplatformCustomerRegisterDao.update(entity, conditions); |
|
|
thirdplatformCustomerRegisterDao.update(entity, conditions); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public List<ThirdPlatformDTO> listPlatforms(String platformName) { |
|
|
|
|
|
return thirdplatformDao.selectListPlatforms(platformName); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void updatePlatform(ThirdPlatformDTO formDTO) { |
|
|
|
|
|
ThirdplatformEntity entity = ConvertUtils.sourceToTarget(formDTO, ThirdplatformEntity.class); |
|
|
|
|
|
thirdplatformDao.updateById(entity); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public ThirdPlatformDTO addPlatform(ThirdPlatformDTO formDTO) { |
|
|
|
|
|
ThirdplatformEntity entity = ConvertUtils.sourceToTarget(formDTO, ThirdplatformEntity.class); |
|
|
|
|
|
thirdplatformDao.insert(entity); |
|
|
|
|
|
formDTO.setId(entity.getId()); |
|
|
|
|
|
return formDTO; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public List<ThirdPlatformDTO> listRegistrablePlatform(CustomerFormDTO formDTO) { |
|
|
|
|
|
return thirdplatformDao.selectListRegistrablePlatform(formDTO.getCustomerId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public List<ThirdPlatformDTO> listRegisteredPlatform(CustomerFormDTO formDTO) { |
|
|
|
|
|
return thirdplatformDao.selectListRegisteredPlatform(formDTO.getCustomerId()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void unregisterPlatformCustomer(PlatformUnregisterFormDTO formDTO) { |
|
|
|
|
|
thirdplatformCustomerRegisterDao.unregisterPlatformCustomer(formDTO); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void registerThirdPlatformCustomer(PlatformRegisterFormDTO formDTO) { |
|
|
|
|
|
List<ThirdplatformCustomerRegisterEntity> entityList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
List<ThirdPlatformDTO> thirdPlatforms = thirdplatformDao.selectListThirdPlatform(formDTO.getPlatformIdList()); |
|
|
|
|
|
for (ThirdPlatformDTO dto : thirdPlatforms) { |
|
|
|
|
|
ThirdplatformCustomerRegisterEntity entity = new ThirdplatformCustomerRegisterEntity(); |
|
|
|
|
|
entity.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
entity.setPlatformId(dto.getId()); |
|
|
|
|
|
entity.setCustomizedPlatformName(dto.getPlatformName()); |
|
|
|
|
|
entity.setCustomizedPlatformIcon(dto.getIcon()); |
|
|
|
|
|
entityList.add(entity); |
|
|
|
|
|
} |
|
|
|
|
|
if (entityList.size() > NumConstant.ZERO) { |
|
|
|
|
|
thirdplatformCustomerRegisterDao.batchInsertThirdplatformCustomerRegister(entityList); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|