Commit 9277084c00c7c44264882fc71db74519c043712b

Authored by xp.Huang
1 parent 9965ff05

fix: A组态修改,会删除B组态节点绑定信息

... ... @@ -37,20 +37,22 @@ public class TkConfigurationContentServiceImpl
37 37 @Transactional
38 38 public ConfigurationContentDTO saveConfigurationContent(
39 39 ConfigurationContentDTO configurationContentDTO) {
40   - freshNodeData(configurationContentDTO.getTenantId(), configurationContentDTO.getContentId(), configurationContentDTO.getNodeIds());
  40 + freshNodeData(configurationContentDTO.getConfigurationId(),configurationContentDTO.getTenantId(), configurationContentDTO.getContentId(), configurationContentDTO.getNodeIds());
41 41 baseMapper.insert(configurationContentDTO.getEntity(TkConfigurationContentEntity.class));
42 42 return configurationContentDTO;
43 43 }
44 44
45 45 /**
46 46 * 刷新组态的结点数据
  47 + * @param configurationId 组态ID
47 48 * @param tenantId 租户ID
48 49 * @param contentId 页签ID
49 50 * @param nodeIds 页面内组件集合
50 51 */
51   - private void freshNodeData(String tenantId,String contentId,List<String> nodeIds){
  52 + private void freshNodeData(String configurationId, String tenantId,String contentId,List<String> nodeIds){
52 53 LambdaQueryWrapper<TkConfigurationDatasourceEntity> datasourceFilter = new QueryWrapper<TkConfigurationDatasourceEntity>().lambda()
53 54 .eq(TkConfigurationDatasourceEntity::getTenantId,tenantId)
  55 + .eq(TkConfigurationDatasourceEntity::getConfigurationId,configurationId)
54 56 .eq(TkConfigurationDatasourceEntity::getContentId,contentId);
55 57 List<TkConfigurationDatasourceEntity> datasources =datasourceMapper.selectList(datasourceFilter);
56 58 datasources.forEach(item ->{
... ... @@ -63,6 +65,7 @@ public class TkConfigurationContentServiceImpl
63 65
64 66 LambdaQueryWrapper<TkConfigurationEventEntity> eventFilter = new QueryWrapper<TkConfigurationEventEntity>().lambda()
65 67 .eq(TkConfigurationEventEntity::getTenantId,tenantId)
  68 + .eq(TkConfigurationEventEntity::getConfigurationId,configurationId)
66 69 .eq(TkConfigurationEventEntity::getContentId,contentId);
67 70 List<TkConfigurationEventEntity> events =eventMapper.selectList(eventFilter);
68 71 events.forEach(item ->{
... ... @@ -75,6 +78,7 @@ public class TkConfigurationContentServiceImpl
75 78
76 79 LambdaQueryWrapper<TkConfigurationActEntity> actFilter = new QueryWrapper<TkConfigurationActEntity>().lambda()
77 80 .eq(TkConfigurationActEntity::getTenantId,tenantId)
  81 + .eq(TkConfigurationActEntity::getConfigurationId,configurationId)
78 82 .eq(TkConfigurationActEntity::getContentId,contentId);
79 83 List<TkConfigurationActEntity> acts =actMapper.selectList(actFilter);
80 84 acts.forEach(item ->{
... ... @@ -95,7 +99,7 @@ public class TkConfigurationContentServiceImpl
95 99 if (!configurationContent.getTenantId().equals(configurationContentDTO.getTenantId())) {
96 100 throw new TkDataValidationException(ErrorMessage.TENANT_MISMATCHING.getMessage());
97 101 }
98   - freshNodeData(configurationContentDTO.getTenantId(), configurationContentDTO.getContentId(), configurationContentDTO.getNodeIds());
  102 + freshNodeData(configurationContentDTO.getConfigurationId(),configurationContentDTO.getTenantId(), configurationContentDTO.getContentId(), configurationContentDTO.getNodeIds());
99 103 baseMapper.updateById(configurationContentDTO.getEntity(TkConfigurationContentEntity.class));
100 104 return configurationContentDTO;
101 105 }
... ...