lin
2024-03-15 cd62fceb02666cd4380776de5109c3eab14dbb90
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java
@@ -212,8 +212,27 @@
      gridBind(placeVO);
      // 警务网格绑定
      jwGridCodeBind(placeVO);
      // 保存从业人员
      savePlacePractitioner(placeVO);
      // 返回结果
      return flag;
   }
   /**
    * 保存从业人员
    *
    * @param placeVO
    */
   private void savePlacePractitioner(PlaceVO placeVO) {
      if (placeVO.getPlacePractitioner() != null) {
         IPlacePractitionerService practitionerService = SpringUtil.getBean(IPlacePractitionerService.class);
         List<PlacePractitionerEntity> placePractitioner = placeVO.getPlacePractitioner();
         for (PlacePractitionerEntity placePractitionerEntity : placePractitioner) {
            placePractitionerEntity.setPlaceId(placeVO.getId());
         }
         practitionerService.saveOrUpdateBatch(placeVO.getPlacePractitioner());
      }
   }
   /**
@@ -715,13 +734,16 @@
   @Transactional(rollbackFor = Exception.class)
   public void savePlaceExtAndTaskInfo(PlaceVO placeVO) {
      PlaceExtEntity placeExtEntity = new PlaceExtEntity();
      placeExtEntity.setPlaceId(placeVO.getId());
      // 判断是否已存在,已存在则不新增
      QueryWrapper<PlaceExtEntity> wrapper = new QueryWrapper<>();
      wrapper.eq("is_deleted", 0)
         .eq("place_id", placeVO.getId());
      PlaceExtEntity one = placeExtService.getOne(wrapper);
      if (null == one) {
      PlaceExtEntity extServiceOne = placeExtService.getOne(wrapper);
      if (null == extServiceOne) {
         // 判断是否有传
         if (placeVO.getPlaceExtEntity() != null) {
            placeExtEntity = placeVO.getPlaceExtEntity();
         }
         placeExtEntity.setPlaceId(placeVO.getId());
         // 默认给待完善状态
         placeExtEntity.setConfirmFlag(4);
@@ -732,7 +754,9 @@
         // 新增场所详情
         placeExtService.save(placeExtEntity);
      } else {
         placeExtService.updateById(placeVO.getPlaceExtEntity());
         if (placeVO.getPlaceExtEntity() != null) {
            placeExtService.updateById(placeVO.getPlaceExtEntity());
         }
      }
   }