|
|
@@ -1,57 +1,28 @@
|
|
|
package com.ylx.massage.service.impl;
|
|
|
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.time.Duration;
|
|
|
-import java.time.LocalDate;
|
|
|
-import java.time.LocalDateTime;
|
|
|
-import java.time.ZoneId;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
-import java.util.*;
|
|
|
-import java.util.function.Function;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ylx.attendanceconfig.domain.AttendanceRule;
|
|
|
import com.ylx.attendanceconfig.mapper.AttendanceRuleMapper;
|
|
|
-import com.ylx.common.core.domain.AjaxResult;
|
|
|
+import com.ylx.collect.service.CollectService;
|
|
|
import com.ylx.common.core.domain.model.LoginUser;
|
|
|
import com.ylx.common.exception.ServiceException;
|
|
|
import com.ylx.common.utils.DateUtils;
|
|
|
import com.ylx.common.utils.DistanceUtil;
|
|
|
import com.ylx.common.utils.StringUtils;
|
|
|
import com.ylx.fareSetting.service.IMaProjectFareSettingService;
|
|
|
-import com.ylx.massage.controller.CityOperationApplicationController;
|
|
|
import com.ylx.massage.domain.*;
|
|
|
import com.ylx.massage.domain.dto.*;
|
|
|
import com.ylx.massage.domain.vo.*;
|
|
|
import com.ylx.massage.enums.*;
|
|
|
import com.ylx.massage.mapper.*;
|
|
|
-import com.ylx.massage.domain.ContractRecord;
|
|
|
-import com.ylx.massage.domain.MaProject;
|
|
|
-import com.ylx.massage.domain.MaTeProject;
|
|
|
-import com.ylx.massage.domain.dto.MaProjectSaveDto;
|
|
|
-import com.ylx.massage.domain.dto.MaTechnicianAuditQueryDTO;
|
|
|
-import com.ylx.massage.domain.dto.MaTechnicianAuditSubmitDTO;
|
|
|
-import com.ylx.massage.domain.dto.MaTechnicianMerchantAddDTO;
|
|
|
-import com.ylx.massage.domain.dto.MaTechnicianMerchantQueryDTO;
|
|
|
-import com.ylx.massage.domain.dto.MassageMerchantRecommendDto;
|
|
|
-import com.ylx.massage.domain.vo.MaTechnicianAppAddVo;
|
|
|
-import com.ylx.massage.domain.vo.MaTechnicianAuditListVO;
|
|
|
-import com.ylx.massage.domain.vo.MaTechnicianCertificateVO;
|
|
|
-import com.ylx.massage.domain.vo.MaTechnicianMerchantDetailVO;
|
|
|
-import com.ylx.massage.domain.vo.MaTechnicianMerchantListVO;
|
|
|
-import com.ylx.massage.domain.vo.MerchantVo;
|
|
|
-import com.ylx.massage.mapper.ContractRecordMapper;
|
|
|
-import com.ylx.massage.mapper.MaProjectMapper;
|
|
|
-import com.ylx.massage.mapper.MaTeProjectMapper;
|
|
|
+import com.ylx.massage.service.IMaTechnicianService;
|
|
|
import com.ylx.massage.service.TAddressService;
|
|
|
-import com.ylx.massage.service.TbFileService;
|
|
|
import com.ylx.merchant.domain.dto.MerchantDetailDTO;
|
|
|
import com.ylx.merchant.domain.dto.MerchantListDTO;
|
|
|
import com.ylx.merchant.domain.dto.MerchantProjectDTO;
|
|
|
@@ -62,17 +33,22 @@ import com.ylx.order.mapper.TOrderMapper;
|
|
|
import com.ylx.project.domain.Project;
|
|
|
import com.ylx.project.domain.bookMerchant.vo.ProjectInfoVO;
|
|
|
import com.ylx.project.mapper.ProjectMapper;
|
|
|
-import lombok.Data;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import com.ylx.massage.service.IMaTechnicianService;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.time.Duration;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.ZoneId;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.util.*;
|
|
|
+import java.util.function.Function;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.ylx.massage.enums.FileTypeEnum.*;
|
|
|
|
|
|
@@ -87,7 +63,6 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
private static final int SERVICE_STATE_AVAILABLE = 1;
|
|
|
private static final int POST_STATE_OFFLINE = 0;
|
|
|
private static final int ENABLED = 1;
|
|
|
- private static final int DEFAULT_AGE = 18;
|
|
|
private static final int AUDIT_APPROVED = 2;
|
|
|
private static final int AUDIT_WAIT_ENTER = 0;
|
|
|
private static final int AUDIT_WAIT_REVIEW = 1;
|
|
|
@@ -101,24 +76,14 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
|
|
|
@Resource
|
|
|
private MaTechnicianMapper maTechnicianMapper;
|
|
|
-
|
|
|
@Resource
|
|
|
private TWxUserMapper tWxUserMapper;
|
|
|
-
|
|
|
@Resource
|
|
|
private MaTeProjectMapper maTeProjectMapper;
|
|
|
-
|
|
|
@Resource
|
|
|
private MaProjectMapper maProjectMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private ProjectMapper projectMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private TbFileService fileService;
|
|
|
@Resource
|
|
|
- private TFareFreeRuleMapper tFareFreeRuleMapper;
|
|
|
-
|
|
|
+ private ProjectMapper projectMapper;
|
|
|
@Resource
|
|
|
private ContractRecordMapper contractRecordMapper;
|
|
|
@Resource
|
|
|
@@ -131,14 +96,14 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
private MerchantApplyFileMapper merchantApplyFileMapper;
|
|
|
@Resource
|
|
|
private TOrderMapper orderMapper;
|
|
|
- @Autowired
|
|
|
- private IMaTechnicianService maTechnicianService;
|
|
|
@Resource
|
|
|
private CityOperationApplicationMapper cityOperationApplicationMapper;
|
|
|
@Resource
|
|
|
private IMaProjectFareSettingService maProjectFareSettingService;
|
|
|
@Resource
|
|
|
private TAddressService addressService;
|
|
|
+ @Resource
|
|
|
+ private CollectService collectService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -1314,6 +1279,7 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
public MerchantDetailVO getDetail(MerchantDetailDTO dto) {
|
|
|
|
|
|
// 1. 获取商户信息
|
|
|
+ Long merchantId = dto.getMerchantId();
|
|
|
MerchantDetailVO detail = this.baseMapper.getDetail(dto);
|
|
|
if (ObjectUtil.isNull(detail)) {
|
|
|
throw new ServiceException("商户不存在");
|
|
|
@@ -1321,9 +1287,9 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
|
|
|
// 2. 获取商户的默认地址
|
|
|
TAddress address = this.addressService.getOne(new LambdaQueryWrapper<TAddress>()
|
|
|
- .eq(TAddress::getMerchantId, dto.getMerchantId())
|
|
|
+ .eq(TAddress::getMerchantId, merchantId)
|
|
|
.eq(TAddress::getIsDefault, 1)
|
|
|
- .eq(TAddress::getIsDelete, 0));
|
|
|
+ .eq(TAddress::getIsDelete, NOT_DELETED));
|
|
|
if (ObjectUtil.isNull(address)) {
|
|
|
throw new ServiceException("无法获取商户的默认地址");
|
|
|
}
|
|
|
@@ -1335,6 +1301,10 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
);
|
|
|
detail.setDistance(distanceStr);
|
|
|
|
|
|
+ // 4. 获取商户是否被当前用户收藏
|
|
|
+ boolean collected = this.collectService.isCollected(merchantId);
|
|
|
+ detail.setCollected(collected);
|
|
|
+
|
|
|
return detail;
|
|
|
}
|
|
|
|