update 平台配置页面

This commit is contained in:
2024-04-29 17:24:16 +08:00
parent e5b3ea7989
commit a41749a127
10 changed files with 222 additions and 29 deletions

View File

@@ -1,15 +1,21 @@
package com.jsowell.pile.service.impl;
import com.google.common.collect.Lists;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.enums.DelFlagEnum;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.SecurityUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.pile.domain.ThirdPartyStationRelation;
import com.jsowell.pile.dto.ThirdPartyStationRelationDTO;
import com.jsowell.pile.mapper.ThirdPartyStationRelationMapper;
import com.jsowell.pile.service.ThirdPartyStationRelationService;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.base.StationInfoVO;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -67,6 +73,11 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe
return thirdPartyStationRelationMapper.selectThirdPartyStationRelationList(thirdPartyStationRelation);
}
@Override
public List<ThirdPartyStationRelation> selectRelationListByStationId(String stationId) {
return thirdPartyStationRelationMapper.selectRelationListByStationId(stationId);
}
@Override
public List<ThirdPartyStationRelation> selectThirdPartyStationRelationList(String thirdPlatformType) {
ThirdPartyStationRelation thirdPartyStationRelation = new ThirdPartyStationRelation();
@@ -132,13 +143,29 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe
/**
* 修改站点、第三方推送平台配置对应
*
* @param thirdPartyStationRelation 站点、第三方推送平台配置对应
* @param dto 站点、第三方推送平台配置对应
* @return 结果
*/
@Override
public int updateThirdPartyStationRelation(ThirdPartyStationRelation thirdPartyStationRelation) {
// stationSettingRelation.setUpdateTime(DateUtils.getNowDate());
return thirdPartyStationRelationMapper.updateThirdPartyStationRelation(thirdPartyStationRelation);
public int updateThirdPartyStationRelation(ThirdPartyStationRelationDTO dto) {
String stationId = dto.getStationId();
// 前端传过来的最新关系
List<String> thirdPartyTypes = dto.getThirdPartyTypes();
if (StringUtils.isBlank(stationId) || CollectionUtils.isEmpty(thirdPartyTypes)) {
throw new BusinessException(ReturnCodeEnum.CODE_PARAM_NOT_NULL_ERROR);
}
// 删除现有的所有站点与第三方平台的活跃关系
thirdPartyStationRelationMapper.deleteThirdPartyStationRelationByStationId(stationId);
List<ThirdPartyStationRelation> list = Lists.newArrayList();
for (String thirdPartyType : thirdPartyTypes) {
ThirdPartyStationRelation build = ThirdPartyStationRelation.builder()
.stationId(Long.parseLong(stationId))
.thirdPartyType(thirdPartyType)
.delFlag(DelFlagEnum.NORMAL.getValue())
.build();
list.add(build);
}
return thirdPartyStationRelationMapper.batchInsert(list);
}
/**