zhongrj
2024-03-07 7b17b9937da0971878998f4cd432e3b2c682ff27
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java
@@ -32,6 +32,8 @@
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.modules.category.entity.CategoryEntity;
import org.springblade.modules.category.service.ICategoryService;
import org.springblade.modules.doorplateAddress.entity.DoorplateAddressEntity;
import org.springblade.modules.doorplateAddress.service.IDoorplateAddressService;
import org.springblade.modules.grid.entity.GridEntity;
@@ -44,6 +46,7 @@
import org.springblade.modules.house.entity.HouseholdEntity;
import org.springblade.modules.house.entity.UserHouseLabelEntity;
import org.springblade.modules.house.service.IHouseholdService;
import org.springblade.modules.label.entity.LabelEntity;
import org.springblade.modules.place.entity.*;
import org.springblade.modules.place.excel.NinePlaceExcel;
import org.springblade.modules.place.excel.PlaceAndRelExcel;
@@ -57,6 +60,7 @@
import org.springblade.modules.police.service.IPoliceAffairsGridService;
import org.springblade.modules.system.entity.Dept;
import org.springblade.modules.system.entity.DictBiz;
import org.springblade.modules.system.entity.Region;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IDictBizService;
@@ -904,8 +908,8 @@
      if (!Strings.isBlank(placeExcel.getPhoneNumber()) &&
         !Strings.isBlank(placeExcel.getName())) {
         PlaceVO placeVO = new PlaceVO();
         placeVO.setPhone(placeExcel.getPhoneNumber());
         placeVO.setUsername(placeExcel.getName());
         placeVO.setPrincipalPhone(placeExcel.getPhoneNumber());
         placeVO.setPrincipal(placeExcel.getName());
         // 更新场所负责人
         User user = bindUserHandle(placeVO);
         // 返回
@@ -952,6 +956,12 @@
            PlaceRelEntity placeRelEntity = new PlaceRelEntity();
            placeRelEntity.setPlaceId(placeEntity.getId());
            placeRelEntity.setStreetName(placeExcel.getStreetName());
            QueryWrapper<Region> wrapper = new QueryWrapper<>();
            wrapper.eq("name",placeExcel.getCommunityName());
            Region region = SpringUtils.getBean(IRegionService.class).getOne(wrapper);
            if (null!=region){
               placeRelEntity.setCommunityCode(region.getCode());
            }
            placeRelEntity.setCommunityName(placeExcel.getCommunityName());
            placeRelEntity.setGridName(placeExcel.getGridName());
            placeRelEntity.setBuildingName(placeExcel.getBuildingName());
@@ -989,13 +999,21 @@
    */
   public void savPlaceLabelBind(PlaceAndRelExcel placeExcel, PlaceEntity placeEntity) {
      if (!Strings.isBlank(placeExcel.getLabelCode())) {
         // 匹配标签
         QueryWrapper<CategoryEntity> wrapper = new QueryWrapper<>();
         wrapper.eq("level",3).eq("category_name",placeExcel.getLabelCode()).eq("is_deleted",0);
         // 查询
         List<CategoryEntity> list = SpringUtils.getBean(ICategoryService.class).list(wrapper);
         if (list.size()>0){
         PlaceVO placeVO = new PlaceVO();
            CategoryEntity categoryEntity = list.get(0);
            placeVO.setLabel(categoryEntity.getCategoryNo());
         placeVO.setId(placeEntity.getId());
         placeVO.setLabel(placeExcel.getLabelCode());
         // 插入标签
         placeLabelBind(placeVO);
      }
   }
   }
   /**
    * 场所数据处理-用户信息(场所负责人信息写入到场所表)