|
|
@ -4,12 +4,16 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.plugin.power.dto.rent.RentTenantInfoDTO; |
|
|
|
import com.epmet.plugin.power.modules.rent.dao.RentTenantInfoDao; |
|
|
|
import com.epmet.plugin.power.modules.rent.entity.RentContractFileEntity; |
|
|
|
import com.epmet.plugin.power.modules.rent.entity.RentTenantInfoEntity; |
|
|
|
import com.epmet.plugin.power.modules.rent.redis.RentTenantInfoRedis; |
|
|
|
import com.epmet.plugin.power.modules.rent.service.RentContractFileService; |
|
|
|
import com.epmet.plugin.power.modules.rent.service.RentTenantInfoService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -32,6 +36,9 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao |
|
|
|
@Autowired |
|
|
|
private RentTenantInfoRedis rentTenantInfoRedis; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private RentContractFileService rentContractFileService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<RentTenantInfoDTO> page(Map<String, Object> params) { |
|
|
|
IPage<RentTenantInfoEntity> page = baseDao.selectPage( |
|
|
@ -72,6 +79,17 @@ public class RentTenantInfoServiceImpl extends BaseServiceImpl<RentTenantInfoDao |
|
|
|
public void save(RentTenantInfoDTO dto) { |
|
|
|
RentTenantInfoEntity entity = ConvertUtils.sourceToTarget(dto, RentTenantInfoEntity.class); |
|
|
|
insert(entity); |
|
|
|
// 处理头像
|
|
|
|
if (dto.getImgList().isEmpty()) { |
|
|
|
throw new EpmetException("照片不能为空"); |
|
|
|
} else { |
|
|
|
List<RentContractFileEntity> imgList = ConvertUtils.sourceToTarget(dto.getImgList(), RentContractFileEntity.class); |
|
|
|
imgList.forEach(img -> { |
|
|
|
img.setReferenceId(entity.getId()); |
|
|
|
img.setFileType(NumConstant.ZERO_STR); |
|
|
|
}); |
|
|
|
rentContractFileService.insertBatch(imgList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|