linwei
2024-01-02 31b6aefacbee9dde61be6afcb7c6dbbf7c6baa7d
src/main/java/org/springblade/modules/place/service/impl/PlaceExtServiceImpl.java
@@ -18,6 +18,7 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.logging.log4j.util.Strings;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.grid.service.IGridService;
import org.springblade.modules.house.entity.HouseTenantEntity;
@@ -102,6 +103,8 @@
      boolean removeFlag = true;
      //更新自身
      boolean update = updateById(placeExt);
      // 更新场所place 表信息
      updatePlaceInfo(placeExt);
      // 查询对应已存在的从业人员
      QueryWrapper<PlacePractitionerEntity> wrapper = new QueryWrapper<>();
      wrapper.eq("place_id",placeExt.getPlaceId());
@@ -153,6 +156,27 @@
   }
   /**
    * 更新场所表信息
    * @param placeExt
    */
   public void updatePlaceInfo(PlaceExtVO placeExt) {
      PlaceEntity placeEntity = new PlaceEntity();
      placeEntity.setId(placeExt.getPlaceId());
      placeEntity.setPlaceName(placeExt.getPlaceName());
      if (!Strings.isBlank(placeExt.getLng())) {
         placeEntity.setLng(placeExt.getLng());
      }
      if (!Strings.isBlank(placeExt.getLat())) {
         placeEntity.setLat(placeExt.getLat());
      }
      if (!Strings.isBlank(placeExt.getLocation())) {
         placeEntity.setLocation(placeExt.getLocation());
      }
      // 更新
      placeService.updateById(placeEntity);
   }
   /**
    * 场所详情表 审核
    * @param placeExt
    * @return
@@ -165,15 +189,15 @@
      placeExt.setConfirmTime(new Date());
      placeExt.setConfirmUserId(AuthUtil.getUserId());
      // 更新数据
      boolean b = updateById(placeExt);
      if (b) {
         PlaceExtEntity entity = getById(placeExt.getId());
         // 更新任务表状态
         TaskEntity taskEntity = new TaskEntity();
         taskEntity.setId(entity.getTaskId());
         taskEntity.setStatus(placeExt.getConfirmFlag());
         flag = taskService.updateById(taskEntity);
      }
      flag = updateById(placeExt);
//      if (b) {
//         PlaceExtEntity entity = getById(placeExt.getId());
//         // 更新任务表状态
//         TaskEntity taskEntity = new TaskEntity();
//         taskEntity.setId(entity.getTaskId());
//         taskEntity.setStatus(placeExt.getConfirmFlag());
//         flag = taskService.updateById(taskEntity);
//      }
      // 返回
      return flag;
   }
@@ -185,26 +209,26 @@
    */
   @Override
   public boolean savePlaceExt(PlaceExtEntity placeExt) {
      PlaceEntity placeEntity = placeService.getById(placeExt.getPlaceId());
      TaskEntity taskEntity = new TaskEntity();
      taskEntity.setId(placeExt.getTaskId());
      taskEntity.setStatus(placeExt.getConfirmFlag());
      taskEntity.setType(1);
      taskEntity.setFrequency(1);
      taskEntity.setName(placeEntity.getPlaceName() + "信息完善");
      // 新增任务
      boolean save = taskService.save(taskEntity);
      if (save){
         placeExt.setTaskId(taskEntity.getId());
//      PlaceEntity placeEntity = placeService.getById(placeExt.getPlaceId());
//      TaskEntity taskEntity = new TaskEntity();
//      taskEntity.setId(placeExt.getTaskId());
//      taskEntity.setStatus(placeExt.getConfirmFlag());
//      taskEntity.setType(1);
//      taskEntity.setFrequency(1);
//      taskEntity.setName(placeEntity.getPlaceName() + "信息完善");
//      // 新增任务
//      boolean save = taskService.save(taskEntity);
//      if (save){
//         placeExt.setTaskId(taskEntity.getId());
         placeExt.setConfirmFlag(1);
         placeExt.setCreateTime(new Date());
         placeExt.setUpdateTime(new Date());
         placeExt.setCreateUser(AuthUtil.getUserId());
         placeExt.setUpdateUser(AuthUtil.getUserId());
         // 新增场所详情
         save(placeExt);
      }
      return false;
         boolean save = save(placeExt);
//      }
      return save;
   }
   /**