mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-19 18:45:03 +08:00
add 更新站点互联互通配置V2
This commit is contained in:
@@ -255,6 +255,16 @@ public class PileStationInfoController extends BaseController {
|
||||
return toAjax(thirdPartyStationRelationService.deleteThirdPartyStationRelation(dto.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新站点互联互通配置
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('pile:station:edit')")
|
||||
@Log(title = "更新站点互联互通配置", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/updateThirdPartyStationRelation")
|
||||
public AjaxResult updateRelation(@RequestBody ThirdPartyStationRelationDTO dto) {
|
||||
return toAjax(thirdPartyStationRelationService.updateThirdPartyStationRelation(dto));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询站点互联互通配置
|
||||
*
|
||||
@@ -400,7 +410,7 @@ public class PileStationInfoController extends BaseController {
|
||||
public AjaxResult updateThirdPartyStationRelation(@RequestBody ThirdPartyStationRelationDTO dto) {
|
||||
AjaxResult result;
|
||||
try {
|
||||
thirdPartyStationRelationService.updateThirdPartyStationRelation(dto);
|
||||
thirdPartyStationRelationService.updateThirdPartyStationRelationV2(dto);
|
||||
result = AjaxResult.success();
|
||||
} catch (Exception e) {
|
||||
logger.error("更新站点与第三方平台关系error,", e);
|
||||
|
||||
@@ -27,4 +27,9 @@ public class ThirdPartyStationRelationDTO {
|
||||
* 关系id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 设备拥有者id
|
||||
*/
|
||||
private String equipmentOwnerId;
|
||||
}
|
||||
|
||||
@@ -134,4 +134,6 @@ public interface ThirdPartyStationRelationService {
|
||||
* @return
|
||||
*/
|
||||
List<ThirdPartyStationRelationVO> getRelationInfoListV2(String stationId);
|
||||
|
||||
void updateThirdPartyStationRelationV2(ThirdPartyStationRelationDTO dto);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ 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 lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -28,6 +29,7 @@ import java.util.List;
|
||||
* @author jsowell
|
||||
* @date 2023-06-06
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRelationService {
|
||||
@Autowired
|
||||
@@ -132,6 +134,8 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe
|
||||
return thirdPartyStationRelationMapper.getRelationInfoListV2(stationId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增站点、第三方推送平台配置对应
|
||||
*
|
||||
@@ -174,6 +178,23 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe
|
||||
return thirdPartyStationRelationMapper.batchInsert(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改站点、第三方推送平台配置对应
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public void updateThirdPartyStationRelationV2(ThirdPartyStationRelationDTO dto) {
|
||||
ThirdPartyStationRelation thirdPartyStationRelation = thirdPartyStationRelationMapper.selectThirdPartyStationRelationById(Long.parseLong(dto.getId()));
|
||||
if (thirdPartyStationRelation == null) {
|
||||
log.error("修改站点、第三方推送平台配置对应信息失败,站点、第三方推送平台配置对应不存在, id:{}", dto.getId());
|
||||
return;
|
||||
}
|
||||
thirdPartyStationRelation.setThirdPartyType(dto.getThirdPartyType());
|
||||
thirdPartyStationRelation.setUpdateTime(DateUtils.getNowDate());
|
||||
thirdPartyStationRelation.setUpdateBy(SecurityUtils.getUsername());
|
||||
thirdPartyStationRelationMapper.updateThirdPartyStationRelation(thirdPartyStationRelation);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除站点、第三方推送平台配置对应
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user