|
|
@@ -13,12 +13,10 @@ import com.ylx.address.service.TAddressService;
|
|
|
import com.ylx.attendanceconfig.domain.AttendanceRule;
|
|
|
import com.ylx.attendanceconfig.mapper.AttendanceRuleMapper;
|
|
|
import com.ylx.collect.service.CollectService;
|
|
|
+import com.ylx.common.core.domain.entity.SysDictData;
|
|
|
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.ServletUtils;
|
|
|
-import com.ylx.common.utils.StringUtils;
|
|
|
+import com.ylx.common.utils.*;
|
|
|
import com.ylx.fareSetting.service.IMaProjectFareSettingService;
|
|
|
import com.ylx.massage.domain.*;
|
|
|
import com.ylx.massage.domain.dto.*;
|
|
|
@@ -37,6 +35,7 @@ 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.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
@@ -56,6 +55,7 @@ import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import static com.ylx.massage.enums.FileTypeEnum.*;
|
|
|
+import static com.ylx.order.constant.OrderConstant.DICT_UNIT_TYPE;
|
|
|
|
|
|
/**
|
|
|
* 技师Service业务层处理
|
|
|
@@ -63,6 +63,7 @@ import static com.ylx.massage.enums.FileTypeEnum.*;
|
|
|
* @author ylx
|
|
|
* @date 2024-03-22
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@Service
|
|
|
public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaTechnician> implements IMaTechnicianService {
|
|
|
private static final int SERVICE_STATE_AVAILABLE = 1;
|
|
|
@@ -129,6 +130,17 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
@Resource
|
|
|
private RedisTemplate<String, String> redisTemplate;
|
|
|
|
|
|
+ private static final Map<String, String> unitDictCache = new HashMap<>();
|
|
|
+
|
|
|
+ static {
|
|
|
+ List<SysDictData> dictList = DictUtils.getSortedDictCache(DICT_UNIT_TYPE);
|
|
|
+ if (CollUtil.isNotEmpty(dictList)) {
|
|
|
+ dictList.forEach(dict -> unitDictCache.put(dict.getDictValue(), dict.getDictLabel()));
|
|
|
+ } else {
|
|
|
+ log.warn("项目计量单位字典未加载,请检查字典配置:{}", DICT_UNIT_TYPE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 商户入驻申请注册
|
|
|
*
|
|
|
@@ -1921,7 +1933,20 @@ public class MaTechnicianServiceImpl extends ServiceImpl<MaTechnicianMapper, MaT
|
|
|
@Override
|
|
|
public Page<ProjectInfoVO> getByMerchantProject(MerchantProjectDTO dto) {
|
|
|
Page<ProjectInfoVO> page = new Page<>(dto.getCurrent(), dto.getSize());
|
|
|
- return this.baseMapper.getByMerchantProject(page, dto);
|
|
|
+ page = this.baseMapper.getByMerchantProject(page, dto);
|
|
|
+ if(ObjectUtil.isNotNull(page) && CollUtil.isNotEmpty(page.getRecords())){
|
|
|
+ List<ProjectInfoVO> records = page.getRecords();
|
|
|
+
|
|
|
+ for (ProjectInfoVO vo : records) {
|
|
|
+ Integer unitType = vo.getUnitType();
|
|
|
+ String unitKey = ObjectUtil.isNotNull(unitType) ? unitType.toString() : "";
|
|
|
+ String unitTypeName = unitDictCache.getOrDefault(unitKey, "未知单位");
|
|
|
+ vo.setUnitTypeName(unitTypeName);
|
|
|
+ }
|
|
|
+ page.setRecords(records);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+ return page;
|
|
|
}
|
|
|
|
|
|
@Override
|