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

@@ -2,7 +2,10 @@ package com.jsowell.pile.domain;
import com.jsowell.common.annotation.Excel;
import com.jsowell.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
@@ -13,6 +16,9 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @date 2023-06-06
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ThirdPartyStationRelation extends BaseEntity {
private static final long serialVersionUID = 1L;

View File

@@ -0,0 +1,20 @@
package com.jsowell.pile.dto;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
@Getter
@Setter
public class ThirdPartyStationRelationDTO {
/**
* 站点id
*/
private String stationId;
/**
* 要推送的第三方平台类型数组
*/
private List<String> thirdPartyTypes;
}

View File

@@ -35,6 +35,7 @@ public interface ThirdPartyStationRelationMapper {
/**
* 查询站点、第三方推送平台配置
*
* @param thirdPartyStationRelation
* @return
*/
@@ -72,9 +73,11 @@ public interface ThirdPartyStationRelationMapper {
*/
public int deleteThirdPartyStationRelationByIds(Long[] ids);
int deleteThirdPartyStationRelationByStationId(String stationId);
/**
* 通过站点id查询该站点对接了哪些第三方平台
*
* @param stationId
* @return
*/
@@ -82,6 +85,7 @@ public interface ThirdPartyStationRelationMapper {
/**
* 修改删除标识为1
*
* @param stationId
* @param type
* @return
@@ -90,6 +94,7 @@ public interface ThirdPartyStationRelationMapper {
/**
* 根据第三方平台类型查询对接第三方平台的运营商列表
*
* @param thirdPlatformType
* @return
*/
@@ -97,8 +102,15 @@ public interface ThirdPartyStationRelationMapper {
/**
* 根据第三方平台类型查询对接第三方平台的站点列表
*
* @param thirdPlatformType
* @return
*/
List<StationInfoVO> selectStationList(String thirdPlatformType);
List<ThirdPartyStationRelation> selectRelationListByStationId(String stationId);
int insertOrUpdateSelective(ThirdPartyStationRelation thirdPartyStationRelation);
int batchInsert(List<ThirdPartyStationRelation> list);
}

View File

@@ -1,6 +1,7 @@
package com.jsowell.pile.service;
import com.jsowell.pile.domain.ThirdPartyStationRelation;
import com.jsowell.pile.dto.ThirdPartyStationRelationDTO;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.base.StationInfoVO;
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
@@ -32,6 +33,8 @@ public interface ThirdPartyStationRelationService {
*/
public List<ThirdPartyStationRelation> selectThirdPartyStationRelationList(ThirdPartyStationRelation thirdPartyStationRelation);
List<ThirdPartyStationRelation> selectRelationListByStationId(String stationId);
List<ThirdPartyStationRelation> selectThirdPartyStationRelationList(String thirdPlatformType);
/**
@@ -73,10 +76,10 @@ public interface ThirdPartyStationRelationService {
/**
* 修改站点、第三方推送平台配置对应
*
* @param thirdPartyStationRelation 站点、第三方推送平台配置对应
* @param dto 站点、第三方推送平台配置对应
* @return 结果
*/
public int updateThirdPartyStationRelation(ThirdPartyStationRelation thirdPartyStationRelation);
public int updateThirdPartyStationRelation(ThirdPartyStationRelationDTO dto);
/**
* 批量删除站点、第三方推送平台配置对应

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);
}
/**