add 更新站点互联互通配置V2

This commit is contained in:
Guoqs
2025-12-05 10:07:50 +08:00
parent a90f0e0a6d
commit d1c3bb562b
4 changed files with 39 additions and 1 deletions

View File

@@ -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);

View File

@@ -27,4 +27,9 @@ public class ThirdPartyStationRelationDTO {
* 关系id
*/
private String id;
/**
* 设备拥有者id
*/
private String equipmentOwnerId;
}

View File

@@ -134,4 +134,6 @@ public interface ThirdPartyStationRelationService {
* @return
*/
List<ThirdPartyStationRelationVO> getRelationInfoListV2(String stationId);
void updateThirdPartyStationRelationV2(ThirdPartyStationRelationDTO dto);
}

View File

@@ -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);
}
/**
* 批量删除站点、第三方推送平台配置对应
*