linwei
2024-01-10 f8d1143ef6cfbbaaebe3b25efa24ee19c9ea61c8
src/main/java/org/springblade/modules/house/service/impl/UserHouseLabelServiceImpl.java
@@ -17,19 +17,22 @@
package org.springblade.modules.house.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.house.dto.UserHouseLabelDTO;
import org.springblade.modules.house.entity.UserHouseLabelEntity;
import org.springblade.modules.house.vo.HouseholdLabelVO;
import org.springblade.modules.house.excel.UserHouseLabelExcel;
import org.springblade.modules.house.mapper.UserHouseLabelMapper;
import org.springblade.modules.house.service.IUserHouseLabelService;
import org.springblade.modules.house.vo.HouseholdLabelVO;
import org.springblade.modules.label.entity.LabelEntity;
import org.springblade.modules.label.service.ILabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
import java.util.Objects;
/**
 * 住户-标签 服务实现类
@@ -78,4 +81,17 @@
      List<Integer> userLabelList = baseMapper.getUserLabelList(userHouseLabelDTO);
      return userLabelList;
   }
   @Override
   public void importUserHouseLabel(List<UserHouseLabelExcel> data, Boolean isCovered) {
      data.forEach(houseHoldExcel -> {
         UserHouseLabelEntity userHouseLabelEntity = Objects.requireNonNull(BeanUtil.copy(houseHoldExcel, UserHouseLabelEntity.class));
         this.save(userHouseLabelEntity);
      });
   }
   @Override
   public IPage<HouseholdLabelVO> statisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel) {
      return page.setRecords(baseMapper.statisticalLabels(page, householdLabel));
   }
}