Commit b231066d by chamberone

fix: 修复重复创建图层bug

1 parent 0492d475
...@@ -163,13 +163,15 @@ public class BusinessLayerServiceImpl implements BusinessLayerService { ...@@ -163,13 +163,15 @@ public class BusinessLayerServiceImpl implements BusinessLayerService {
@Transactional @Transactional
@Override @Override
public Result<?> businessCustomLayerAdd(String branchId, String layerName, String layerDesc, List<String> skillCodes) { public Result<?> businessCustomLayerAdd(String branchId, String layerName, String layerDesc, List<String> skillCodes) {
if (orgBranchDao.getByBranchId(branchId) == null) { if (orgBranchDao.getByBranchId(branchId) == null) {
throw new BusinessException("分部参数错误,请联系管理员/研发"); throw new BusinessException("分部参数错误,请联系管理员/研发");
} }
String layerId = UUID.randomUUID().toString().replace("-", "");
// 同步创建saas图层,返回layerId // 同步创建saas图层,返回layerId
String result = saasRemoteService.addLayer(ak, layerName, 1, 1); String saasLayerName = branchId + "_" + layerId;
String result = saasRemoteService.addLayer(ak, saasLayerName, 1, 1);
log.info("addLayer params:{} result:{}", layerName, result); log.info("addLayer params:{} result:{}", layerName, result);
Result<LinkedTreeMap<String, Object>> saasResult = TypeUtils.convertResult(result); Result<LinkedTreeMap<String, Object>> saasResult = TypeUtils.convertResult(result);
if (!ResultEnum.SUCCESS.getCode().equals(saasResult.getCode())) { if (!ResultEnum.SUCCESS.getCode().equals(saasResult.getCode())) {
...@@ -177,8 +179,6 @@ public class BusinessLayerServiceImpl implements BusinessLayerService { ...@@ -177,8 +179,6 @@ public class BusinessLayerServiceImpl implements BusinessLayerService {
} }
String saasLayerId = (String) saasResult.getResult().get("id");// 存入pea String saasLayerId = (String) saasResult.getResult().get("id");// 存入pea
String layerId = UUID.randomUUID().toString().replace("-", "");
// 入库保存 // 入库保存
MapLayerCustomizeEntity m = new MapLayerCustomizeEntity(); MapLayerCustomizeEntity m = new MapLayerCustomizeEntity();
m.setLayerId(layerId); m.setLayerId(layerId);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!