Quellcode durchsuchen

优化合同段编辑时地理位置信息修改逻辑

lvy vor 2 Tagen
Ursprung
Commit
c6bdbed32a

+ 6 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ContractInfoServiceImpl.java

@@ -1034,7 +1034,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                 }
             }
 
-            return this.submitContractRelevantInfo(row, contractInfo);
+            return this.submitContractRelevantInfo(row, contractInfo, null);
 
         } else {
             //修改
@@ -1135,7 +1135,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
             }
             //}
 
-            return this.submitContractRelevantInfo(row, contractInfo);
+            return this.submitContractRelevantInfo(row, contractInfo, contractInfo1.getProjectPlace());
         }
     }
 
@@ -1194,7 +1194,7 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
     }
 
     @Async
-    boolean submitContractRelevantInfo(boolean row, ContractInfoVO contractInfo) {
+    boolean submitContractRelevantInfo(boolean row, ContractInfoVO contractInfo, String oldProjectPlace) {
         if (row) {
             List<SaveUserInfoByProjectDTO> list = saveUserInfoByProjectMapper.selectList(Wrappers.<SaveUserInfoByProjectDTO>query().lambda()
                     .eq(SaveUserInfoByProjectDTO::getProjectId, contractInfo.getPId())
@@ -1208,6 +1208,9 @@ public class ContractInfoServiceImpl extends BaseServiceImpl<ContractInfoMapper,
                 });
             }
             String projectPlace = contractInfo.getProjectPlace();
+            if (projectPlace == null || projectPlace.trim().isEmpty() || contractInfo.getProjectPlace().equals(oldProjectPlace)) {
+                return true;
+            }
             Map<String, String> position = new HashMap<>();
             try {
                 Map<String, Object> addressInfo = BaiduApiUtil.geocoding(projectPlace);