mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-23 20:45:10 +08:00
update 平台配置页面
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user