You've already forked FrameTour-BE
Merge branch 'rem_scenic_device'
This commit is contained in:
@@ -2,12 +2,14 @@ package com.ycwl.basic.profitsharing.controller;
|
|||||||
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.ycwl.basic.integration.scenic.dto.scenic.ScenicV2DTO;
|
||||||
import com.ycwl.basic.profitsharing.dto.ProfitSharingConfigReqQuery;
|
import com.ycwl.basic.profitsharing.dto.ProfitSharingConfigReqQuery;
|
||||||
import com.ycwl.basic.profitsharing.dto.ProfitSharingConfigVO;
|
import com.ycwl.basic.profitsharing.dto.ProfitSharingConfigVO;
|
||||||
import com.ycwl.basic.profitsharing.entity.ProfitSharingConfig;
|
import com.ycwl.basic.profitsharing.entity.ProfitSharingConfig;
|
||||||
import com.ycwl.basic.profitsharing.entity.ProfitSharingUser;
|
import com.ycwl.basic.profitsharing.entity.ProfitSharingUser;
|
||||||
import com.ycwl.basic.profitsharing.mapper.ProfitSharingConfigMapper;
|
import com.ycwl.basic.profitsharing.mapper.ProfitSharingConfigMapper;
|
||||||
import com.ycwl.basic.profitsharing.mapper.ProfitSharingUserMapper;
|
import com.ycwl.basic.profitsharing.mapper.ProfitSharingUserMapper;
|
||||||
|
import com.ycwl.basic.repository.ScenicRepository;
|
||||||
import com.ycwl.basic.utils.ApiResponse;
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -24,11 +26,22 @@ public class ProfitSharingConfigController {
|
|||||||
private ProfitSharingConfigMapper configMapper;
|
private ProfitSharingConfigMapper configMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProfitSharingUserMapper userMapper;
|
private ProfitSharingUserMapper userMapper;
|
||||||
|
@Autowired
|
||||||
|
private ScenicRepository scenicRepository;
|
||||||
|
|
||||||
// 新增: 分页查询接口
|
// 新增: 分页查询接口
|
||||||
@PostMapping("/page")
|
@PostMapping("/page")
|
||||||
public ApiResponse<PageInfo<ProfitSharingConfigVO>> pageQuery(@RequestBody ProfitSharingConfigReqQuery req) {
|
public ApiResponse<PageInfo<ProfitSharingConfigVO>> pageQuery(@RequestBody ProfitSharingConfigReqQuery req) {
|
||||||
PageHelper.startPage(req.getPageNum(), req.getPageSize());
|
PageHelper.startPage(req.getPageNum(), req.getPageSize());
|
||||||
List<ProfitSharingConfigVO> list = configMapper.list(req);
|
List<ProfitSharingConfigVO> list = configMapper.list(req);
|
||||||
|
list.forEach(item -> {
|
||||||
|
try {
|
||||||
|
ScenicV2DTO scenicBasic = scenicRepository.getScenicBasic(item.getScenicId());
|
||||||
|
item.setScenicName(scenicBasic.getName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
item.setScenicName("");
|
||||||
|
}
|
||||||
|
});
|
||||||
PageInfo<ProfitSharingConfigVO> pageInfo = new PageInfo<>(list);
|
PageInfo<ProfitSharingConfigVO> pageInfo = new PageInfo<>(list);
|
||||||
return ApiResponse.success(pageInfo);
|
return ApiResponse.success(pageInfo);
|
||||||
}
|
}
|
||||||
|
@@ -12,6 +12,7 @@ import com.ycwl.basic.profitsharing.entity.ProfitSharingUser;
|
|||||||
import com.ycwl.basic.profitsharing.mapper.ProfitSharingRecordMapper;
|
import com.ycwl.basic.profitsharing.mapper.ProfitSharingRecordMapper;
|
||||||
import com.ycwl.basic.profitsharing.repository.ProfitSharingRepository;
|
import com.ycwl.basic.profitsharing.repository.ProfitSharingRepository;
|
||||||
import com.ycwl.basic.profitsharing.service.ProfitSharingRecordService;
|
import com.ycwl.basic.profitsharing.service.ProfitSharingRecordService;
|
||||||
|
import com.ycwl.basic.repository.ScenicRepository;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -29,6 +30,8 @@ public class ProfitSharingRecordServiceImpl implements ProfitSharingRecordServic
|
|||||||
private ProfitSharingRecordMapper profitSharingRecordMapper;
|
private ProfitSharingRecordMapper profitSharingRecordMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProfitSharingRepository profitSharingRepository;
|
private ProfitSharingRepository profitSharingRepository;
|
||||||
|
@Autowired
|
||||||
|
private ScenicRepository scenicRepository;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -42,7 +45,19 @@ public class ProfitSharingRecordServiceImpl implements ProfitSharingRecordServic
|
|||||||
return respVo;
|
return respVo;
|
||||||
}
|
}
|
||||||
List<ProfitSharingRecordRespVO> recordList = profitSharingRecordMapper.listByOrderIds(list.stream().map(ProfitSharingRecordGroupVO::getOrderId).collect(Collectors.toList()));
|
List<ProfitSharingRecordRespVO> recordList = profitSharingRecordMapper.listByOrderIds(list.stream().map(ProfitSharingRecordGroupVO::getOrderId).collect(Collectors.toList()));
|
||||||
List<Long> scenicList = recordList.stream().map(ProfitSharingRecordRespVO::getScenicId).distinct().collect(Collectors.toList());
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = recordList.stream().map(ProfitSharingRecordRespVO::getScenicId).distinct().collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
recordList.forEach(item -> {
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
List<Long> scenicList = scenicIds;
|
||||||
List<ProfitSharingConfig> scenicConfig = scenicList.stream()
|
List<ProfitSharingConfig> scenicConfig = scenicList.stream()
|
||||||
.map(scenicId -> profitSharingRepository.getScenicConfig(scenicId))
|
.map(scenicId -> profitSharingRepository.getScenicConfig(scenicId))
|
||||||
.filter(item -> !Objects.isNull(item) && !Objects.isNull(item.getUsers()))
|
.filter(item -> !Objects.isNull(item) && !Objects.isNull(item.getUsers()))
|
||||||
|
@@ -17,6 +17,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -165,4 +167,77 @@ public class DeviceRepository {
|
|||||||
}
|
}
|
||||||
return List.of();
|
return List.of();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量获取设备信息
|
||||||
|
* @param deviceIds 设备ID列表
|
||||||
|
* @return 设备ID到设备实体的映射
|
||||||
|
*/
|
||||||
|
public Map<Long, DeviceEntity> batchGetDevices(List<Long> deviceIds) {
|
||||||
|
if (deviceIds == null || deviceIds.isEmpty()) {
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<Long, DeviceEntity> result = new HashMap<>();
|
||||||
|
for (Long deviceId : deviceIds) {
|
||||||
|
try {
|
||||||
|
DeviceEntity device = getDevice(deviceId);
|
||||||
|
if (device != null) {
|
||||||
|
result.put(deviceId, device);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取设备信息失败: {}, 错误: {}", deviceId, e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量根据设备编号获取设备信息
|
||||||
|
* @param deviceNos 设备编号列表
|
||||||
|
* @return 设备编号到设备实体的映射
|
||||||
|
*/
|
||||||
|
public Map<String, DeviceEntity> batchGetDevicesByNo(List<String> deviceNos) {
|
||||||
|
if (deviceNos == null || deviceNos.isEmpty()) {
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, DeviceEntity> result = new HashMap<>();
|
||||||
|
for (String deviceNo : deviceNos) {
|
||||||
|
try {
|
||||||
|
DeviceEntity device = getDeviceByDeviceNo(deviceNo);
|
||||||
|
if (device != null) {
|
||||||
|
result.put(deviceNo, device);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("根据设备编号获取设备信息失败: {}, 错误: {}", deviceNo, e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量获取设备名称
|
||||||
|
* @param deviceIds 设备ID列表
|
||||||
|
* @return 设备ID到设备名称的映射
|
||||||
|
*/
|
||||||
|
public Map<Long, String> batchGetDeviceNames(List<Long> deviceIds) {
|
||||||
|
if (deviceIds == null || deviceIds.isEmpty()) {
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<Long, String> result = new HashMap<>();
|
||||||
|
for (Long deviceId : deviceIds) {
|
||||||
|
try {
|
||||||
|
DeviceEntity device = getDevice(deviceId);
|
||||||
|
if (device != null) {
|
||||||
|
result.put(deviceId, device.getName());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取设备名称失败: {}, 错误: {}", deviceId, e.getMessage());
|
||||||
|
result.put(deviceId, "未知设备");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,9 @@ import org.springframework.data.redis.core.RedisTemplate;
|
|||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class ScenicRepository {
|
public class ScenicRepository {
|
||||||
@@ -359,4 +362,79 @@ public class ScenicRepository {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量获取景区名称
|
||||||
|
* @param scenicIds 景区ID列表
|
||||||
|
* @return 景区ID到景区名称的映射
|
||||||
|
*/
|
||||||
|
public Map<Long, String> batchGetScenicNames(List<Long> scenicIds) {
|
||||||
|
if (scenicIds == null || scenicIds.isEmpty()) {
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<Long, String> result = new HashMap<>();
|
||||||
|
for (Long scenicId : scenicIds) {
|
||||||
|
try {
|
||||||
|
ScenicV2DTO scenic = getScenicBasic(scenicId);
|
||||||
|
if (scenic != null) {
|
||||||
|
result.put(scenicId, scenic.getName());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 获取失败时使用默认值
|
||||||
|
result.put(scenicId, "未知景区");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量获取景区完整信息
|
||||||
|
* @param scenicIds 景区ID列表
|
||||||
|
* @return 景区ID到景区实体的映射
|
||||||
|
*/
|
||||||
|
public Map<Long, ScenicEntity> batchGetScenics(List<Long> scenicIds) {
|
||||||
|
if (scenicIds == null || scenicIds.isEmpty()) {
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<Long, ScenicEntity> result = new HashMap<>();
|
||||||
|
for (Long scenicId : scenicIds) {
|
||||||
|
try {
|
||||||
|
ScenicEntity scenic = getScenic(scenicId);
|
||||||
|
if (scenic != null) {
|
||||||
|
result.put(scenicId, scenic);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 获取失败时记录日志但不中断处理
|
||||||
|
System.err.println("获取景区信息失败: " + scenicId + ", 错误: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量获取景区基础信息DTO
|
||||||
|
* @param scenicIds 景区ID列表
|
||||||
|
* @return 景区ID到景区DTO的映射
|
||||||
|
*/
|
||||||
|
public Map<Long, ScenicV2DTO> batchGetScenicBasics(List<Long> scenicIds) {
|
||||||
|
if (scenicIds == null || scenicIds.isEmpty()) {
|
||||||
|
return new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<Long, ScenicV2DTO> result = new HashMap<>();
|
||||||
|
for (Long scenicId : scenicIds) {
|
||||||
|
try {
|
||||||
|
ScenicV2DTO scenic = getScenicBasic(scenicId);
|
||||||
|
if (scenic != null) {
|
||||||
|
result.put(scenicId, scenic);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 获取失败时记录日志但不中断处理
|
||||||
|
System.err.println("获取景区基础信息失败: " + scenicId + ", 错误: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -306,6 +306,8 @@ public class AppScenicServiceImpl implements AppScenicService {
|
|||||||
}
|
}
|
||||||
List<DeviceRespVO> extraDeviceList = extraDeviceMapper.listExtraDeviceByScenicId(scenicId);
|
List<DeviceRespVO> extraDeviceList = extraDeviceMapper.listExtraDeviceByScenicId(scenicId);
|
||||||
for (DeviceRespVO deviceRespVO : extraDeviceList) {
|
for (DeviceRespVO deviceRespVO : extraDeviceList) {
|
||||||
|
ScenicV2DTO scenicBasic = scenicRepository.getScenicBasic(deviceRespVO.getScenicId());
|
||||||
|
deviceRespVO.setScenicName(scenicBasic.getName());
|
||||||
if (redisTemplate.hasKey("ext_device:online:"+deviceRespVO.getNo())) {
|
if (redisTemplate.hasKey("ext_device:online:"+deviceRespVO.getNo())) {
|
||||||
String onlineTs = redisTemplate.opsForValue().get("ext_device:online:"+deviceRespVO.getNo());
|
String onlineTs = redisTemplate.opsForValue().get("ext_device:online:"+deviceRespVO.getNo());
|
||||||
if (!StringUtils.isNumeric(onlineTs)) {
|
if (!StringUtils.isNumeric(onlineTs)) {
|
||||||
|
@@ -3,6 +3,8 @@ package com.ycwl.basic.service.mobile.impl;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import com.ycwl.basic.integration.scenic.dto.scenic.ScenicV2DTO;
|
||||||
|
import com.ycwl.basic.model.pc.scenic.entity.ScenicEntity;
|
||||||
import com.ycwl.basic.utils.JacksonUtil;
|
import com.ycwl.basic.utils.JacksonUtil;
|
||||||
import com.ycwl.basic.biz.CouponBiz;
|
import com.ycwl.basic.biz.CouponBiz;
|
||||||
import com.ycwl.basic.biz.OrderBiz;
|
import com.ycwl.basic.biz.OrderBiz;
|
||||||
@@ -117,7 +119,12 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
GoodsPageVO goodsPageVO = new GoodsPageVO();
|
GoodsPageVO goodsPageVO = new GoodsPageVO();
|
||||||
goodsPageVO.setGoodsName(videoRespVO.getTemplateName());
|
goodsPageVO.setGoodsName(videoRespVO.getTemplateName());
|
||||||
goodsPageVO.setScenicId(videoRespVO.getScenicId());
|
goodsPageVO.setScenicId(videoRespVO.getScenicId());
|
||||||
goodsPageVO.setScenicName(videoRespVO.getScenicName());
|
try {
|
||||||
|
ScenicV2DTO scenic = scenicRepository.getScenicBasic(videoRespVO.getScenicId());
|
||||||
|
goodsPageVO.setScenicName(scenic.getName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
goodsPageVO.setScenicName("");
|
||||||
|
}
|
||||||
goodsPageVO.setGoodsType(0);
|
goodsPageVO.setGoodsType(0);
|
||||||
goodsPageVO.setFaceId(videoRespVO.getFaceId());
|
goodsPageVO.setFaceId(videoRespVO.getFaceId());
|
||||||
goodsPageVO.setGoodsId(videoRespVO.getId());
|
goodsPageVO.setGoodsId(videoRespVO.getId());
|
||||||
@@ -206,7 +213,12 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
goodsDetailVO.setGoodsName(goodsNamePrefix + i + " " + shootingTime);
|
goodsDetailVO.setGoodsName(goodsNamePrefix + i + " " + shootingTime);
|
||||||
}
|
}
|
||||||
goodsDetailVO.setScenicId(sourceRespVO.getScenicId());
|
goodsDetailVO.setScenicId(sourceRespVO.getScenicId());
|
||||||
goodsDetailVO.setScenicName(sourceRespVO.getScenicName());
|
try {
|
||||||
|
ScenicV2DTO scenic = scenicRepository.getScenicBasic(sourceRespVO.getScenicId());
|
||||||
|
goodsDetailVO.setScenicName(scenic.getName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
goodsDetailVO.setScenicName("");
|
||||||
|
}
|
||||||
goodsDetailVO.setGoodsType(sourceType);
|
goodsDetailVO.setGoodsType(sourceType);
|
||||||
goodsDetailVO.setFaceId(face.getId());
|
goodsDetailVO.setFaceId(face.getId());
|
||||||
goodsDetailVO.setGoodsId(sourceRespVO.getId());
|
goodsDetailVO.setGoodsId(sourceRespVO.getId());
|
||||||
@@ -245,7 +257,12 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
}
|
}
|
||||||
goodsDetailVO.setGoodsName(videoRespVO.getTemplateName());
|
goodsDetailVO.setGoodsName(videoRespVO.getTemplateName());
|
||||||
goodsDetailVO.setScenicId(videoRespVO.getScenicId());
|
goodsDetailVO.setScenicId(videoRespVO.getScenicId());
|
||||||
goodsDetailVO.setScenicName(videoRespVO.getScenicName());
|
try {
|
||||||
|
ScenicV2DTO scenic = scenicRepository.getScenicBasic(videoRespVO.getScenicId());
|
||||||
|
goodsDetailVO.setScenicName(scenic.getName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
goodsDetailVO.setScenicName("");
|
||||||
|
}
|
||||||
goodsDetailVO.setGoodsType(0);
|
goodsDetailVO.setGoodsType(0);
|
||||||
goodsDetailVO.setGoodsId(videoRespVO.getId());
|
goodsDetailVO.setGoodsId(videoRespVO.getId());
|
||||||
goodsDetailVO.setVideoUrl(videoRespVO.getVideoUrl());
|
goodsDetailVO.setVideoUrl(videoRespVO.getVideoUrl());
|
||||||
@@ -483,7 +500,12 @@ public class GoodsServiceImpl implements GoodsService {
|
|||||||
GoodsDetailVO goodsDetailVO = new GoodsDetailVO();
|
GoodsDetailVO goodsDetailVO = new GoodsDetailVO();
|
||||||
goodsDetailVO.setGoodsName("原片");
|
goodsDetailVO.setGoodsName("原片");
|
||||||
goodsDetailVO.setScenicId(sourceRespVO.getScenicId());
|
goodsDetailVO.setScenicId(sourceRespVO.getScenicId());
|
||||||
goodsDetailVO.setScenicName(sourceRespVO.getScenicName());
|
try {
|
||||||
|
ScenicV2DTO scenic = scenicRepository.getScenicBasic(sourceRespVO.getScenicId());
|
||||||
|
goodsDetailVO.setScenicName(scenic.getName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
goodsDetailVO.setScenicName("");
|
||||||
|
}
|
||||||
goodsDetailVO.setGoodsType(sourceRespVO.getType());
|
goodsDetailVO.setGoodsType(sourceRespVO.getType());
|
||||||
goodsDetailVO.setGoodsId(sourceRespVO.getId());
|
goodsDetailVO.setGoodsId(sourceRespVO.getId());
|
||||||
if (sourceRespVO.getVideoUrl() != null) {
|
if (sourceRespVO.getVideoUrl() != null) {
|
||||||
|
@@ -6,11 +6,15 @@ import com.ycwl.basic.mapper.BrokerMapper;
|
|||||||
import com.ycwl.basic.model.pc.broker.entity.BrokerEntity;
|
import com.ycwl.basic.model.pc.broker.entity.BrokerEntity;
|
||||||
import com.ycwl.basic.model.pc.broker.req.BrokerReqQuery;
|
import com.ycwl.basic.model.pc.broker.req.BrokerReqQuery;
|
||||||
import com.ycwl.basic.model.pc.broker.resp.BrokerRespVO;
|
import com.ycwl.basic.model.pc.broker.resp.BrokerRespVO;
|
||||||
|
import com.ycwl.basic.repository.ScenicRepository;
|
||||||
import com.ycwl.basic.service.pc.BrokerService;
|
import com.ycwl.basic.service.pc.BrokerService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:longbinbin
|
* @Author:longbinbin
|
||||||
@@ -21,18 +25,53 @@ public class BrokerServiceImpl implements BrokerService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private BrokerMapper brokerMapper;
|
private BrokerMapper brokerMapper;
|
||||||
|
@Autowired
|
||||||
|
private ScenicRepository scenicRepository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<BrokerRespVO> pageQuery(BrokerReqQuery brokerReqQuery) {
|
public PageInfo<BrokerRespVO> pageQuery(BrokerReqQuery brokerReqQuery) {
|
||||||
PageHelper.startPage(brokerReqQuery.getPageNum(),brokerReqQuery.getPageSize());
|
PageHelper.startPage(brokerReqQuery.getPageNum(),brokerReqQuery.getPageSize());
|
||||||
List<BrokerRespVO> list = brokerMapper.list(brokerReqQuery);
|
List<BrokerRespVO> list = brokerMapper.list(brokerReqQuery);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(BrokerRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
list.forEach(item -> {
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
PageInfo<BrokerRespVO> pageInfo = new PageInfo(list);
|
PageInfo<BrokerRespVO> pageInfo = new PageInfo(list);
|
||||||
return pageInfo;
|
return pageInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<BrokerRespVO> list(BrokerReqQuery brokerReqQuery) {
|
public List<BrokerRespVO> list(BrokerReqQuery brokerReqQuery) {
|
||||||
return brokerMapper.list(brokerReqQuery);
|
List<BrokerRespVO> list = brokerMapper.list(brokerReqQuery);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(BrokerRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
list.forEach(item -> {
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -3,17 +3,23 @@ import com.ycwl.basic.mapper.CouponMapper;
|
|||||||
import com.ycwl.basic.model.pc.coupon.entity.CouponEntity;
|
import com.ycwl.basic.model.pc.coupon.entity.CouponEntity;
|
||||||
import com.ycwl.basic.model.pc.coupon.req.CouponQueryReq;
|
import com.ycwl.basic.model.pc.coupon.req.CouponQueryReq;
|
||||||
import com.ycwl.basic.model.pc.coupon.resp.CouponRespVO;
|
import com.ycwl.basic.model.pc.coupon.resp.CouponRespVO;
|
||||||
|
import com.ycwl.basic.repository.ScenicRepository;
|
||||||
import com.ycwl.basic.service.pc.CouponService;
|
import com.ycwl.basic.service.pc.CouponService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class CouponServiceImpl implements CouponService {
|
public class CouponServiceImpl implements CouponService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private CouponMapper couponMapper;
|
private CouponMapper couponMapper;
|
||||||
|
@Autowired
|
||||||
|
private ScenicRepository scenicRepository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Integer add(CouponEntity coupon) {
|
public Integer add(CouponEntity coupon) {
|
||||||
@@ -38,6 +44,22 @@ public class CouponServiceImpl implements CouponService {
|
|||||||
@Override
|
@Override
|
||||||
public List<CouponRespVO> list(CouponQueryReq query) {
|
public List<CouponRespVO> list(CouponQueryReq query) {
|
||||||
List<CouponRespVO> list = couponMapper.selectByQuery(query);
|
List<CouponRespVO> list = couponMapper.selectByQuery(query);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(CouponRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
list.forEach(item -> {
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -53,6 +53,7 @@ import com.ycwl.basic.pay.adapter.IPayAdapter;
|
|||||||
import com.ycwl.basic.pay.entity.PayResponse;
|
import com.ycwl.basic.pay.entity.PayResponse;
|
||||||
import com.ycwl.basic.repository.FaceRepository;
|
import com.ycwl.basic.repository.FaceRepository;
|
||||||
import com.ycwl.basic.repository.PriceRepository;
|
import com.ycwl.basic.repository.PriceRepository;
|
||||||
|
import com.ycwl.basic.repository.ScenicRepository;
|
||||||
import com.ycwl.basic.repository.TemplateRepository;
|
import com.ycwl.basic.repository.TemplateRepository;
|
||||||
import com.ycwl.basic.repository.VideoRepository;
|
import com.ycwl.basic.repository.VideoRepository;
|
||||||
import com.ycwl.basic.repository.VideoTaskRepository;
|
import com.ycwl.basic.repository.VideoTaskRepository;
|
||||||
@@ -129,6 +130,8 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ScenicService scenicService;
|
private ScenicService scenicService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private ScenicRepository scenicRepository;
|
||||||
|
@Autowired
|
||||||
private VideoMapper videoMapper;
|
private VideoMapper videoMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IVoucherService iVoucherService;
|
private IVoucherService iVoucherService;
|
||||||
@@ -139,7 +142,21 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
public ApiResponse<PageInfo<OrderRespVO>> pageQuery(OrderReqQuery query) {
|
public ApiResponse<PageInfo<OrderRespVO>> pageQuery(OrderReqQuery query) {
|
||||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||||
List<OrderRespVO> list = orderMapper.list(query);
|
List<OrderRespVO> list = orderMapper.list(query);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(OrderRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
|
// 设置景区名称
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
|
|
||||||
if (Integer.valueOf(-1).equals(item.getType())) {
|
if (Integer.valueOf(-1).equals(item.getType())) {
|
||||||
item.setGoodsName("一口价");
|
item.setGoodsName("一口价");
|
||||||
item.setOrderType("一口价");
|
item.setOrderType("一口价");
|
||||||
@@ -181,8 +198,21 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
public ApiResponse<PageInfo<OrderRespVO>> pageQueryDetail(OrderReqQuery query) {
|
public ApiResponse<PageInfo<OrderRespVO>> pageQueryDetail(OrderReqQuery query) {
|
||||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||||
List<OrderRespVO> list = orderMapper.listDetail(query);
|
List<OrderRespVO> list = orderMapper.listDetail(query);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(OrderRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
for (OrderRespVO item : list) {
|
for (OrderRespVO item : list) {
|
||||||
item.setPrice(item.getPayPrice());
|
item.setPrice(item.getPayPrice());
|
||||||
|
// 设置景区名称
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PageInfo<OrderRespVO> pageInfo = new PageInfo<>(list);
|
PageInfo<OrderRespVO> pageInfo = new PageInfo<>(list);
|
||||||
return ApiResponse.success(pageInfo);
|
return ApiResponse.success(pageInfo);
|
||||||
@@ -191,8 +221,21 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
@Override
|
@Override
|
||||||
public ApiResponse<List<OrderRespVO>> list(OrderReqQuery query) {
|
public ApiResponse<List<OrderRespVO>> list(OrderReqQuery query) {
|
||||||
List<OrderRespVO> list = orderMapper.list(query);
|
List<OrderRespVO> list = orderMapper.list(query);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(OrderRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
for (OrderRespVO item : list) {
|
for (OrderRespVO item : list) {
|
||||||
item.setPrice(item.getPayPrice());
|
item.setPrice(item.getPayPrice());
|
||||||
|
// 设置景区名称
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ApiResponse.success(list);
|
return ApiResponse.success(list);
|
||||||
}
|
}
|
||||||
@@ -307,6 +350,18 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
order.setGoodsList(goodsList);
|
order.setGoodsList(goodsList);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
if (order.getScenicId() != null) {
|
||||||
|
try {
|
||||||
|
String scenicName = scenicRepository.batchGetScenicNames(List.of(order.getScenicId()))
|
||||||
|
.get(order.getScenicId());
|
||||||
|
order.setScenicName(scenicName);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取景区名称失败: {}", order.getScenicId(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ApiResponse.success(order);
|
return ApiResponse.success(order);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -426,6 +481,22 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(OrderAppRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
list.forEach(order -> {
|
||||||
|
if (order.getScenicId() != null) {
|
||||||
|
order.setScenicName(scenicNames.get(order.getScenicId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
PageInfo<OrderAppRespVO> pageInfo = new PageInfo<>(list);
|
PageInfo<OrderAppRespVO> pageInfo = new PageInfo<>(list);
|
||||||
return ApiResponse.success(pageInfo);
|
return ApiResponse.success(pageInfo);
|
||||||
}
|
}
|
||||||
@@ -433,6 +504,18 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
@Override
|
@Override
|
||||||
public ApiResponse<OrderAppRespVO> appDetail(Long id) {
|
public ApiResponse<OrderAppRespVO> appDetail(Long id) {
|
||||||
OrderAppRespVO orderAppRespVO = orderMapper.appDetail(id);
|
OrderAppRespVO orderAppRespVO = orderMapper.appDetail(id);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
if (orderAppRespVO != null && orderAppRespVO.getScenicId() != null) {
|
||||||
|
try {
|
||||||
|
String scenicName = scenicRepository.batchGetScenicNames(List.of(orderAppRespVO.getScenicId()))
|
||||||
|
.get(orderAppRespVO.getScenicId());
|
||||||
|
orderAppRespVO.setScenicName(scenicName);
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.warn("获取景区名称失败: {}", orderAppRespVO.getScenicId(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ApiResponse.success(orderAppRespVO);
|
return ApiResponse.success(orderAppRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -473,7 +556,21 @@ public class OrderServiceImpl implements OrderService {
|
|||||||
public ApiResponse<PageInfo<OrderRespVO>> refundPageQuery(OrderReqQuery query) {
|
public ApiResponse<PageInfo<OrderRespVO>> refundPageQuery(OrderReqQuery query) {
|
||||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||||
List<OrderRespVO> list = orderMapper.refundList(query);
|
List<OrderRespVO> list = orderMapper.refundList(query);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(OrderRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
|
// 设置景区名称
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
|
|
||||||
if (Integer.valueOf(-1).equals(item.getType())) {
|
if (Integer.valueOf(-1).equals(item.getType())) {
|
||||||
item.setGoodsName("一口价");
|
item.setGoodsName("一口价");
|
||||||
item.setOrderType("一口价");
|
item.setOrderType("一口价");
|
||||||
|
@@ -3,6 +3,7 @@ package com.ycwl.basic.service.pc.impl;
|
|||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.ycwl.basic.exception.BaseException;
|
import com.ycwl.basic.exception.BaseException;
|
||||||
|
import com.ycwl.basic.integration.scenic.dto.scenic.ScenicV2DTO;
|
||||||
import com.ycwl.basic.mapper.SourceMapper;
|
import com.ycwl.basic.mapper.SourceMapper;
|
||||||
import com.ycwl.basic.model.pc.device.entity.DeviceEntity;
|
import com.ycwl.basic.model.pc.device.entity.DeviceEntity;
|
||||||
import com.ycwl.basic.model.pc.scenic.entity.ScenicEntity;
|
import com.ycwl.basic.model.pc.scenic.entity.ScenicEntity;
|
||||||
@@ -28,6 +29,9 @@ import java.net.MalformedURLException;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.ycwl.basic.constant.StorageConstant.PHOTO_PATH;
|
import static com.ycwl.basic.constant.StorageConstant.PHOTO_PATH;
|
||||||
|
|
||||||
@@ -52,14 +56,31 @@ public class SourceServiceImpl implements SourceService {
|
|||||||
public ApiResponse<PageInfo<SourceRespVO>> pageQuery(SourceReqQuery sourceReqQuery) {
|
public ApiResponse<PageInfo<SourceRespVO>> pageQuery(SourceReqQuery sourceReqQuery) {
|
||||||
PageHelper.startPage(sourceReqQuery.getPageNum(), sourceReqQuery.getPageSize());
|
PageHelper.startPage(sourceReqQuery.getPageNum(), sourceReqQuery.getPageSize());
|
||||||
List<SourceRespVO> list = sourceMapper.list(sourceReqQuery);
|
List<SourceRespVO> list = sourceMapper.list(sourceReqQuery);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(SourceRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 批量获取设备名称
|
||||||
|
List<Long> deviceIds = list.stream()
|
||||||
|
.map(SourceRespVO::getDeviceId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> deviceNames = deviceRepository.batchGetDeviceNames(deviceIds);
|
||||||
|
|
||||||
list.forEach(sourceRespVO -> {
|
list.forEach(sourceRespVO -> {
|
||||||
ScenicEntity scenic = scenicRepository.getScenic(sourceRespVO.getScenicId());
|
// 设置景区名称
|
||||||
if (scenic != null) {
|
if (sourceRespVO.getScenicId() != null) {
|
||||||
sourceRespVO.setScenicName(scenic.getName());
|
sourceRespVO.setScenicName(scenicNames.get(sourceRespVO.getScenicId()));
|
||||||
}
|
}
|
||||||
DeviceEntity device = deviceRepository.getDevice(sourceRespVO.getDeviceId());
|
// 设置设备名称
|
||||||
if (device != null) {
|
if (sourceRespVO.getDeviceId() != null) {
|
||||||
sourceRespVO.setDeviceName(device.getName());
|
sourceRespVO.setDeviceName(deviceNames.get(sourceRespVO.getDeviceId()));
|
||||||
}
|
}
|
||||||
if (sourceRespVO.getVideoUrl() != null) {
|
if (sourceRespVO.getVideoUrl() != null) {
|
||||||
try {
|
try {
|
||||||
@@ -82,7 +103,32 @@ public class SourceServiceImpl implements SourceService {
|
|||||||
@Override
|
@Override
|
||||||
public ApiResponse<List<SourceRespVO>> list(SourceReqQuery sourceReqQuery) {
|
public ApiResponse<List<SourceRespVO>> list(SourceReqQuery sourceReqQuery) {
|
||||||
List<SourceRespVO> list = sourceMapper.list(sourceReqQuery);
|
List<SourceRespVO> list = sourceMapper.list(sourceReqQuery);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(SourceRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 批量获取设备名称
|
||||||
|
List<Long> deviceIds = list.stream()
|
||||||
|
.map(SourceRespVO::getDeviceId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> deviceNames = deviceRepository.batchGetDeviceNames(deviceIds);
|
||||||
|
|
||||||
list.forEach(sourceRespVO -> {
|
list.forEach(sourceRespVO -> {
|
||||||
|
// 设置景区名称
|
||||||
|
if (sourceRespVO.getScenicId() != null) {
|
||||||
|
sourceRespVO.setScenicName(scenicNames.get(sourceRespVO.getScenicId()));
|
||||||
|
}
|
||||||
|
// 设置设备名称
|
||||||
|
if (sourceRespVO.getDeviceId() != null) {
|
||||||
|
sourceRespVO.setDeviceName(deviceNames.get(sourceRespVO.getDeviceId()));
|
||||||
|
}
|
||||||
if (sourceRespVO.getVideoUrl() != null) {
|
if (sourceRespVO.getVideoUrl() != null) {
|
||||||
try {
|
try {
|
||||||
URL url = new URL(sourceRespVO.getVideoUrl());
|
URL url = new URL(sourceRespVO.getVideoUrl());
|
||||||
@@ -116,6 +162,12 @@ public class SourceServiceImpl implements SourceService {
|
|||||||
sourceRespVO.setVideoUrl(sourceRespVO.getVideoUrl());
|
sourceRespVO.setVideoUrl(sourceRespVO.getVideoUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
ScenicV2DTO scenicBasic = scenicRepository.getScenicBasic(sourceRespVO.getScenicId());
|
||||||
|
sourceRespVO.setScenicName(scenicBasic.getName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
sourceRespVO.setScenicName("");
|
||||||
|
}
|
||||||
return ApiResponse.success(sourceRespVO);
|
return ApiResponse.success(sourceRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,6 +11,7 @@ import com.ycwl.basic.pricing.enums.ProductType;
|
|||||||
import com.ycwl.basic.pricing.service.IPricingManagementService;
|
import com.ycwl.basic.pricing.service.IPricingManagementService;
|
||||||
import com.ycwl.basic.service.pc.TemplateService;
|
import com.ycwl.basic.service.pc.TemplateService;
|
||||||
import com.ycwl.basic.repository.TemplateRepository;
|
import com.ycwl.basic.repository.TemplateRepository;
|
||||||
|
import com.ycwl.basic.repository.ScenicRepository;
|
||||||
import com.ycwl.basic.utils.ApiResponse;
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
import com.ycwl.basic.utils.SnowFlakeUtil;
|
import com.ycwl.basic.utils.SnowFlakeUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -18,8 +19,11 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:longbinbin
|
* @Author:longbinbin
|
||||||
@@ -33,19 +37,54 @@ public class TemplateServiceImpl implements TemplateService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TemplateRepository templateRepository;
|
private TemplateRepository templateRepository;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private ScenicRepository scenicRepository;
|
||||||
|
@Autowired
|
||||||
private IPricingManagementService pricingManagementService;
|
private IPricingManagementService pricingManagementService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<PageInfo<TemplateRespVO>> pageQuery(TemplateReqQuery templateReqQuery) {
|
public ApiResponse<PageInfo<TemplateRespVO>> pageQuery(TemplateReqQuery templateReqQuery) {
|
||||||
PageHelper.startPage(templateReqQuery.getPageNum(), templateReqQuery.getPageSize());
|
PageHelper.startPage(templateReqQuery.getPageNum(), templateReqQuery.getPageSize());
|
||||||
List<TemplateRespVO> list = templateMapper.list(templateReqQuery);
|
List<TemplateRespVO> list = templateMapper.list(templateReqQuery);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(TemplateRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
list.forEach(item -> {
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
PageInfo<TemplateRespVO> pageInfo = new PageInfo<>(list);
|
PageInfo<TemplateRespVO> pageInfo = new PageInfo<>(list);
|
||||||
return ApiResponse.success(pageInfo);
|
return ApiResponse.success(pageInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<List<TemplateRespVO>> list(TemplateReqQuery templateReqQuery) {
|
public ApiResponse<List<TemplateRespVO>> list(TemplateReqQuery templateReqQuery) {
|
||||||
return ApiResponse.success(templateMapper.list(templateReqQuery));
|
List<TemplateRespVO> list = templateMapper.list(templateReqQuery);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(TemplateRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
list.forEach(item -> {
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return ApiResponse.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -5,12 +5,16 @@ import com.github.pagehelper.PageInfo;
|
|||||||
import com.ycwl.basic.mapper.VideoMapper;
|
import com.ycwl.basic.mapper.VideoMapper;
|
||||||
import com.ycwl.basic.model.pc.video.req.VideoReqQuery;
|
import com.ycwl.basic.model.pc.video.req.VideoReqQuery;
|
||||||
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
import com.ycwl.basic.model.pc.video.resp.VideoRespVO;
|
||||||
|
import com.ycwl.basic.repository.ScenicRepository;
|
||||||
import com.ycwl.basic.service.pc.VideoService;
|
import com.ycwl.basic.service.pc.VideoService;
|
||||||
import com.ycwl.basic.utils.ApiResponse;
|
import com.ycwl.basic.utils.ApiResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:longbinbin
|
* @Author:longbinbin
|
||||||
@@ -21,18 +25,53 @@ public class VideoServiceImpl implements VideoService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VideoMapper videoMapper;
|
private VideoMapper videoMapper;
|
||||||
|
@Autowired
|
||||||
|
private ScenicRepository scenicRepository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<PageInfo<VideoRespVO>> pageQuery(VideoReqQuery videoReqQuery) {
|
public ApiResponse<PageInfo<VideoRespVO>> pageQuery(VideoReqQuery videoReqQuery) {
|
||||||
PageHelper.startPage(videoReqQuery.getPageNum(), videoReqQuery.getPageSize());
|
PageHelper.startPage(videoReqQuery.getPageNum(), videoReqQuery.getPageSize());
|
||||||
List<VideoRespVO> list = videoMapper.list(videoReqQuery);
|
List<VideoRespVO> list = videoMapper.list(videoReqQuery);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(VideoRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
list.forEach(item -> {
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
PageInfo<VideoRespVO> pageInfo = new PageInfo<>(list);
|
PageInfo<VideoRespVO> pageInfo = new PageInfo<>(list);
|
||||||
return ApiResponse.success(pageInfo);
|
return ApiResponse.success(pageInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ApiResponse<List<VideoRespVO>> list(VideoReqQuery videoReqQuery) {
|
public ApiResponse<List<VideoRespVO>> list(VideoReqQuery videoReqQuery) {
|
||||||
return ApiResponse.success(videoMapper.list(videoReqQuery));
|
List<VideoRespVO> list = videoMapper.list(videoReqQuery);
|
||||||
|
|
||||||
|
// 批量获取景区名称
|
||||||
|
List<Long> scenicIds = list.stream()
|
||||||
|
.map(VideoRespVO::getScenicId)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
Map<Long, String> scenicNames = scenicRepository.batchGetScenicNames(scenicIds);
|
||||||
|
|
||||||
|
// 设置景区名称
|
||||||
|
list.forEach(item -> {
|
||||||
|
if (item.getScenicId() != null) {
|
||||||
|
item.setScenicName(scenicNames.get(item.getScenicId()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return ApiResponse.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -42,7 +42,7 @@
|
|||||||
(select min(r.create_time) from broker_record r where r.broker_id = b.id) as first_broker_date,
|
(select min(r.create_time) from broker_record r where r.broker_id = b.id) as first_broker_date,
|
||||||
(select max(r.create_time) from broker_record r where r.broker_id = b.id) as last_broker_date,
|
(select max(r.create_time) from broker_record r where r.broker_id = b.id) as last_broker_date,
|
||||||
b.create_at, b.update_at
|
b.create_at, b.update_at
|
||||||
from broker b left join scenic s on b.scenic_id = s.id
|
from broker b
|
||||||
<where>
|
<where>
|
||||||
<if test="scenicId!= null">
|
<if test="scenicId!= null">
|
||||||
and b.scenic_id = #{scenicId}
|
and b.scenic_id = #{scenicId}
|
||||||
@@ -65,8 +65,8 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="getById" resultType="com.ycwl.basic.model.pc.broker.resp.BrokerRespVO">
|
<select id="getById" resultType="com.ycwl.basic.model.pc.broker.resp.BrokerRespVO">
|
||||||
select b.id, scenic_id, s.name as scenicName, b.`name`, b.phone, b.broker_enable, b.broker_rate, b.status, b.create_at, b.update_at
|
select b.id, scenic_id, b.`name`, b.phone, b.broker_enable, b.broker_rate, b.status, b.create_at, b.update_at
|
||||||
from broker b left join scenic s on b.scenic_id = s.id
|
from broker b
|
||||||
where b.id = #{id}
|
where b.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
@@ -10,13 +10,12 @@
|
|||||||
</update>
|
</update>
|
||||||
<select id="selectByQuery" resultType="com.ycwl.basic.model.pc.coupon.resp.CouponRespVO">
|
<select id="selectByQuery" resultType="com.ycwl.basic.model.pc.coupon.resp.CouponRespVO">
|
||||||
SELECT
|
SELECT
|
||||||
c.id, scenic_id AS scenicId, s.name as scenicName,
|
c.id, scenic_id AS scenicId,
|
||||||
c.name AS name, c.description AS description, c.countdown AS countdown, c.broadcast,
|
c.name AS name, c.description AS description, c.countdown AS countdown, c.broadcast,
|
||||||
config_ids AS configIds, discount_price AS discountPrice,
|
config_ids AS configIds, discount_price AS discountPrice,
|
||||||
type, discount_type AS discountType,
|
type, discount_type AS discountType,
|
||||||
c.status, c.create_at
|
c.status, c.create_at
|
||||||
FROM coupon c
|
FROM coupon c
|
||||||
LEFT JOIN scenic s ON c.scenic_id = s.id
|
|
||||||
<where>
|
<where>
|
||||||
AND c.deleted = 0
|
AND c.deleted = 0
|
||||||
<if test="scenicId != null">AND scenic_id = #{scenicId}</if>
|
<if test="scenicId != null">AND scenic_id = #{scenicId}</if>
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<select id="listExtraDeviceByScenicId" resultType="com.ycwl.basic.model.pc.device.resp.DeviceRespVO">
|
<select id="listExtraDeviceByScenicId" resultType="com.ycwl.basic.model.pc.device.resp.DeviceRespVO">
|
||||||
select d.id, d.ident as no, d.scenic_id, d.name, d.status, s.name as scenic_name
|
select d.id, d.ident as no, d.scenic_id, d.name, d.status, s.name as scenic_name
|
||||||
from extra_device d
|
from extra_device d
|
||||||
left join scenic s on d.scenic_id = s.id
|
|
||||||
where d.scenic_id = #{scenicId}
|
where d.scenic_id = #{scenicId}
|
||||||
and d.status = 1
|
and d.status = 1
|
||||||
</select>
|
</select>
|
||||||
|
@@ -110,8 +110,7 @@
|
|||||||
oi.order_id AS orderId,
|
oi.order_id AS orderId,
|
||||||
oi.goods_id,
|
oi.goods_id,
|
||||||
msd.source_id,
|
msd.source_id,
|
||||||
sc.id AS scenic_id,
|
o.scenic_id AS scenic_id,
|
||||||
sc.name AS scenic_name,
|
|
||||||
CASE oi.goods_type
|
CASE oi.goods_type
|
||||||
WHEN '0' THEN mvd.cover_url
|
WHEN '0' THEN mvd.cover_url
|
||||||
WHEN '3' THEN mpd.url
|
WHEN '3' THEN mpd.url
|
||||||
@@ -147,7 +146,6 @@
|
|||||||
END AS imgUrl
|
END AS imgUrl
|
||||||
FROM order_item oi
|
FROM order_item oi
|
||||||
LEFT JOIN `order` o ON oi.order_id = o.id
|
LEFT JOIN `order` o ON oi.order_id = o.id
|
||||||
LEFT JOIN scenic sc ON o.scenic_id = sc.id
|
|
||||||
LEFT JOIN member_video_data mvd ON o.face_id = mvd.face_id AND oi.goods_id = mvd.video_id
|
LEFT JOIN member_video_data mvd ON o.face_id = mvd.face_id AND oi.goods_id = mvd.video_id
|
||||||
LEFT JOIN member_source_data msd ON o.face_id = msd.face_id AND oi.goods_id = msd.face_id AND msd.type = oi.goods_type
|
LEFT JOIN member_source_data msd ON o.face_id = msd.face_id AND oi.goods_id = msd.face_id AND msd.type = oi.goods_type
|
||||||
LEFT JOIN member_photo_data mpd ON oi.goods_id = mpd.id AND mpd.type = oi.goods_type
|
LEFT JOIN member_photo_data mpd ON oi.goods_id = mpd.id AND mpd.type = oi.goods_type
|
||||||
@@ -238,13 +236,12 @@
|
|||||||
delete from `order` where id = #{id}
|
delete from `order` where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
<select id="list" resultMap="PCBaseResultListMap">
|
<select id="list" resultMap="PCBaseResultListMap">
|
||||||
select o.id, o.scenic_id, s.name as scenic_name, o.member_id,m.nickname, m.uid, o.type, o.openid, o.face_id, f.face_url, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
select o.id, o.scenic_id, o.member_id,m.nickname, m.uid, o.type, o.openid, o.face_id, f.face_url, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
||||||
o.coupon_price,
|
o.coupon_price,
|
||||||
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at, o.create_at
|
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at, o.create_at
|
||||||
from `order` AS o
|
from `order` AS o
|
||||||
left join face f on o.face_id = f.id
|
left join face f on o.face_id = f.id
|
||||||
left join member m on o.member_id = m.id
|
left join member m on o.member_id = m.id
|
||||||
left join scenic s on o.scenic_id = s.id
|
|
||||||
<where>
|
<where>
|
||||||
<if test="id!= null ">
|
<if test="id!= null ">
|
||||||
and o.id LIKE CONCAT('%',#{id},'%')
|
and o.id LIKE CONCAT('%',#{id},'%')
|
||||||
@@ -312,13 +309,12 @@
|
|||||||
order by o.create_at desc
|
order by o.create_at desc
|
||||||
</select>
|
</select>
|
||||||
<select id="listDetail" resultMap="PCBaseResultMap">
|
<select id="listDetail" resultMap="PCBaseResultMap">
|
||||||
select o.id, o.scenic_id, s.name as scenic_name, o.member_id,m.nickname, m.uid, o.type, o.openid, o.face_id, f.face_url, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
select o.id, o.scenic_id, o.member_id,m.nickname, m.uid, o.type, o.openid, o.face_id, f.face_url, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
||||||
o.coupon_price,
|
o.coupon_price,
|
||||||
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at, o.create_at
|
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at, o.create_at
|
||||||
from `order` AS o
|
from `order` AS o
|
||||||
left join face f on o.face_id = f.id
|
left join face f on o.face_id = f.id
|
||||||
left join member m on o.member_id = m.id
|
left join member m on o.member_id = m.id
|
||||||
left join scenic s on o.scenic_id = s.id
|
|
||||||
<where>
|
<where>
|
||||||
<if test="id!= null ">
|
<if test="id!= null ">
|
||||||
and o.id = #{id}
|
and o.id = #{id}
|
||||||
@@ -378,14 +374,13 @@
|
|||||||
order by o.create_at desc
|
order by o.create_at desc
|
||||||
</select>
|
</select>
|
||||||
<select id="getById" resultMap="PCBaseResultMap">
|
<select id="getById" resultMap="PCBaseResultMap">
|
||||||
select o.id, o.scenic_id, s.name as scenic_name, o.member_id, o.type, o.openid, o.face_id, f.face_url, o.price, o.pay_price, o.remark, o.broker_id, o.promo_code, o.refund_reason,
|
select o.id, o.scenic_id, o.member_id, o.type, o.openid, o.face_id, f.face_url, o.price, o.pay_price, o.remark, o.broker_id, o.promo_code, o.refund_reason,
|
||||||
o.coupon_price,
|
o.coupon_price,
|
||||||
o.refund_status, o.status, o.create_at, o.update_at, o.pay_at, o.cancel_at, o.refund_at,
|
o.refund_status, o.status, o.create_at, o.update_at, o.pay_at, o.cancel_at, o.refund_at,
|
||||||
m.nickname, m.uid
|
m.nickname, m.uid
|
||||||
from `order` o
|
from `order` o
|
||||||
left join face f on o.face_id = f.id
|
left join face f on o.face_id = f.id
|
||||||
left join member m on m.id = o.member_id
|
left join member m on m.id = o.member_id
|
||||||
left join scenic s on o.scenic_id = s.id
|
|
||||||
where o.id = #{id}
|
where o.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="countByUserId" resultType="java.lang.Integer">
|
<select id="countByUserId" resultType="java.lang.Integer">
|
||||||
@@ -397,10 +392,9 @@
|
|||||||
select o.id, o.member_id,o.openid, o.type, o.face_id, f.face_url, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
select o.id, o.member_id,o.openid, o.type, o.face_id, f.face_url, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
||||||
o.coupon_price,
|
o.coupon_price,
|
||||||
refund_reason, refund_status, o.`status`, o.create_at, refund_at, pay_at, cancel_at,
|
refund_reason, refund_status, o.`status`, o.create_at, refund_at, pay_at, cancel_at,
|
||||||
sc.name scenicName
|
o.scenic_id
|
||||||
from `order` AS o
|
from `order` AS o
|
||||||
left join face f on o.face_id = f.id
|
left join face f on o.face_id = f.id
|
||||||
left join scenic sc on o.scenic_id = sc.id
|
|
||||||
<where>
|
<where>
|
||||||
<if test="memberId!=null">
|
<if test="memberId!=null">
|
||||||
and o.member_id=#{memberId}
|
and o.member_id=#{memberId}
|
||||||
@@ -412,18 +406,16 @@
|
|||||||
select o.id, o.member_id, o.face_id,o.openid, o.type, o.price, o.slash_price, pay_price, remark, o.broker_id, o.promo_code,
|
select o.id, o.member_id, o.face_id,o.openid, o.type, o.price, o.slash_price, pay_price, remark, o.broker_id, o.promo_code,
|
||||||
o.coupon_price,
|
o.coupon_price,
|
||||||
refund_reason, refund_status, o.`status`, o.create_at, refund_at, pay_at, cancel_at,
|
refund_reason, refund_status, o.`status`, o.create_at, refund_at, pay_at, cancel_at,
|
||||||
o.scenic_id, sc.name scenicName
|
o.scenic_id
|
||||||
from `order` AS o
|
from `order` AS o
|
||||||
left join member m on o.member_id = m.id
|
left join member m on o.member_id = m.id
|
||||||
left join scenic sc on o.scenic_id = sc.id
|
|
||||||
where o.id = #{id}
|
where o.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="refundList" resultType="com.ycwl.basic.model.pc.order.resp.OrderRespVO">
|
<select id="refundList" resultType="com.ycwl.basic.model.pc.order.resp.OrderRespVO">
|
||||||
select o.id, o.scenic_id, s.name as scenic_name, o.member_id,m.nickname,m.uid as memberUid , o.type, o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
select o.id, o.scenic_id, o.member_id,m.nickname,m.uid as memberUid , o.type, o.openid, o.price, pay_price, remark, o.broker_id, o.promo_code,
|
||||||
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at, o.create_at
|
refund_reason, refund_status, o.`status`, refund_at, pay_at, cancel_at, o.create_at
|
||||||
from `order` AS o
|
from `order` AS o
|
||||||
left join member m on o.member_id = m.id
|
left join member m on o.member_id = m.id
|
||||||
left join scenic s on o.scenic_id = s.id
|
|
||||||
<where>
|
<where>
|
||||||
o.refund_status != 0
|
o.refund_status != 0
|
||||||
<if test="id!= null ">
|
<if test="id!= null ">
|
||||||
|
@@ -34,14 +34,12 @@
|
|||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="getById" resultType="com.ycwl.basic.model.pc.price.resp.PriceConfigRespVO">
|
<select id="getById" resultType="com.ycwl.basic.model.pc.price.resp.PriceConfigRespVO">
|
||||||
select p.*, s.name as scenic_name from price_config p
|
select p.* from price_config p
|
||||||
left join scenic s on s.id = p.scenic_id
|
|
||||||
where p.id = #{id}
|
where p.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="listByCondition" resultType="com.ycwl.basic.model.pc.price.resp.PriceConfigRespVO">
|
<select id="listByCondition" resultType="com.ycwl.basic.model.pc.price.resp.PriceConfigRespVO">
|
||||||
select p.*, s.name as scenic_name from price_config p
|
select p.* from price_config p
|
||||||
left join scenic s on s.id = p.scenic_id
|
|
||||||
<where>
|
<where>
|
||||||
<if test="req.scenicId != null">
|
<if test="req.scenicId != null">
|
||||||
and p.scenic_id = #{req.scenicId}
|
and p.scenic_id = #{req.scenicId}
|
||||||
|
@@ -33,44 +33,39 @@
|
|||||||
select * from print_task WHERE id = #{id}
|
select * from print_task WHERE id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="listByScenicId" resultType="com.ycwl.basic.model.pc.printer.resp.PrinterResp">
|
<select id="listByScenicId" resultType="com.ycwl.basic.model.pc.printer.resp.PrinterResp">
|
||||||
SELECT p.*, s.name as scenic_name
|
SELECT p.*
|
||||||
FROM printer p
|
FROM printer p
|
||||||
LEFT JOIN scenic s on s.id = p.scenic_id
|
|
||||||
WHERE p.scenic_id = #{scenicId} and p.status = 1
|
WHERE p.scenic_id = #{scenicId} and p.status = 1
|
||||||
</select>
|
</select>
|
||||||
<select id="listRelation" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
|
<select id="listRelation" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
|
||||||
SELECT p.id, p.scenic_id as scenicId, s.name as scenicName, p.member_id as memberId,
|
SELECT p.id, p.scenic_id as scenicId, p.member_id as memberId,
|
||||||
p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
|
p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
|
||||||
p.status, p.create_time as createTime, p.printer_id
|
p.status, p.create_time as createTime, p.printer_id
|
||||||
FROM member_print p
|
FROM member_print p
|
||||||
LEFT JOIN scenic s ON s.id = p.scenic_id
|
|
||||||
WHERE p.member_id = #{memberId} AND p.scenic_id = #{scenicId} AND p.status = 0
|
WHERE p.member_id = #{memberId} AND p.scenic_id = #{scenicId} AND p.status = 0
|
||||||
</select>
|
</select>
|
||||||
<select id="getUserPhoto" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
|
<select id="getUserPhoto" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
|
||||||
SELECT p.id, p.scenic_id, s.name as scenicName, p.member_id as memberId,
|
SELECT p.id, p.scenic_id, p.member_id as memberId,
|
||||||
p.member_id, p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
|
p.member_id, p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
|
||||||
p.status, p.create_time as createTime, p.printer_id
|
p.status, p.create_time as createTime, p.printer_id
|
||||||
FROM member_print p
|
FROM member_print p
|
||||||
LEFT JOIN scenic s ON s.id = p.scenic_id
|
|
||||||
WHERE p.id = #{id} AND p.member_id = #{memberId} AND p.scenic_id = #{scenicId}
|
WHERE p.id = #{id} AND p.member_id = #{memberId} AND p.scenic_id = #{scenicId}
|
||||||
</select>
|
</select>
|
||||||
<select id="getUserPhotoByIds" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
|
<select id="getUserPhotoByIds" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
|
||||||
SELECT p.id, p.scenic_id, s.name as scenicName, p.member_id as memberId,
|
SELECT p.id, p.scenic_id, p.member_id as memberId,
|
||||||
p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
|
p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
|
||||||
p.status, p.create_time as createTime, p.printer_id
|
p.status, p.create_time as createTime, p.printer_id
|
||||||
FROM member_print p
|
FROM member_print p
|
||||||
LEFT JOIN scenic s ON s.id = p.scenic_id
|
|
||||||
WHERE p.id IN
|
WHERE p.id IN
|
||||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
<select id="listRelationByOrderId" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
|
<select id="listRelationByOrderId" resultType="com.ycwl.basic.model.pc.printer.resp.MemberPrintResp">
|
||||||
SELECT p.id, p.scenic_id as scenicId, s.name as scenicName, p.member_id as memberId,
|
SELECT p.id, p.scenic_id as scenicId, p.member_id as memberId,
|
||||||
p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
|
p.orig_url as origUrl, p.crop_url as cropUrl, p.order_id as orderId, p.quantity,
|
||||||
p.status, p.create_time as createTime, p.printer_id
|
p.status, p.create_time as createTime, p.printer_id
|
||||||
FROM member_print p
|
FROM member_print p
|
||||||
LEFT JOIN scenic s ON s.id = p.scenic_id
|
|
||||||
WHERE p.id in (select order_item.goods_id from order_item where order_item.order_id = #{orderId} and order_item.goods_type = 3)
|
WHERE p.id in (select order_item.goods_id from order_item where order_item.order_id = #{orderId} and order_item.goods_type = 3)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.ycwl.basic.profitsharing.mapper.ProfitSharingConfigMapper">
|
<mapper namespace="com.ycwl.basic.profitsharing.mapper.ProfitSharingConfigMapper">
|
||||||
<select id="list" resultType="com.ycwl.basic.profitsharing.dto.ProfitSharingConfigVO">
|
<select id="list" resultType="com.ycwl.basic.profitsharing.dto.ProfitSharingConfigVO">
|
||||||
SELECT c.*, s.name as scenic_name
|
SELECT c.*
|
||||||
FROM profit_sharing_config c
|
FROM profit_sharing_config c
|
||||||
left join scenic s on c.scenic_id = s.id
|
|
||||||
<where>
|
<where>
|
||||||
<if test="scenicId != null">
|
<if test="scenicId != null">
|
||||||
AND scenic_id = #{scenicId}
|
AND scenic_id = #{scenicId}
|
||||||
|
@@ -14,9 +14,8 @@
|
|||||||
WHERE scenic_id = #{scenicId} AND order_id = #{orderId}
|
WHERE scenic_id = #{scenicId} AND order_id = #{orderId}
|
||||||
</update>
|
</update>
|
||||||
<select id="list" resultType="com.ycwl.basic.profitsharing.dto.ProfitSharingRecordRespVO">
|
<select id="list" resultType="com.ycwl.basic.profitsharing.dto.ProfitSharingRecordRespVO">
|
||||||
SELECT r.*, s.name as scenic_name
|
SELECT r.*
|
||||||
FROM profit_sharing_record r
|
FROM profit_sharing_record r
|
||||||
LEFT JOIN scenic s ON s.id = r.scenic_id
|
|
||||||
<where>
|
<where>
|
||||||
<if test="withDeleted != true">
|
<if test="withDeleted != true">
|
||||||
delete_time is null
|
delete_time is null
|
||||||
@@ -65,9 +64,8 @@
|
|||||||
GROUP BY order_id
|
GROUP BY order_id
|
||||||
</select>
|
</select>
|
||||||
<select id="listByOrderIds" resultType="com.ycwl.basic.profitsharing.dto.ProfitSharingRecordRespVO">
|
<select id="listByOrderIds" resultType="com.ycwl.basic.profitsharing.dto.ProfitSharingRecordRespVO">
|
||||||
SELECT r.*, s.name as scenic_name
|
SELECT r.*
|
||||||
FROM profit_sharing_record r
|
FROM profit_sharing_record r
|
||||||
LEFT JOIN scenic s ON s.id = r.scenic_id
|
|
||||||
WHERE r.order_id IN
|
WHERE r.order_id IN
|
||||||
<foreach collection="orderIds" item="orderId" open="(" close=")" separator=",">
|
<foreach collection="orderIds" item="orderId" open="(" close=")" separator=",">
|
||||||
#{orderId}
|
#{orderId}
|
||||||
|
@@ -91,13 +91,13 @@
|
|||||||
select so.id, ms.scenic_id, device_id, ms.member_id, url, ms.is_free, so.create_time, so.update_time,sc.`name` as scenicName
|
select so.id, ms.scenic_id, device_id, ms.member_id, url, ms.is_free, so.create_time, so.update_time,sc.`name` as scenicName
|
||||||
from member_source ms
|
from member_source ms
|
||||||
left join source so on ms.source_id = so.id
|
left join source so on ms.source_id = so.id
|
||||||
left join scenic sc on sc.id = so.scenic_id
|
|
||||||
where so.id = #{id} and ms.member_id = #{userId} and so.id is not null
|
where so.id = #{id} and ms.member_id = #{userId} and so.id is not null
|
||||||
</select>
|
</select>
|
||||||
<select id="getById" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
<select id="getById" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
||||||
select so.id, scenic_id, device_id, url, video_url, so.create_time, so.update_time,sc.`name` as scenicName
|
select so.id, scenic_id, device_id, url, video_url, so.create_time, so.update_time,sc.`name` as scenicName
|
||||||
from source so
|
from source so
|
||||||
left join scenic sc on sc.id = so.scenic_id
|
|
||||||
where so.id = #{id}
|
where so.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="listGroupByType" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
<select id="listGroupByType" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
|
||||||
@@ -141,7 +141,7 @@
|
|||||||
select so.id, ms.scenic_id, device_id, url, ms.is_free, so.create_time, so.update_time,sc.`name` as scenicName, ms.is_buy, video_url
|
select so.id, ms.scenic_id, device_id, url, ms.is_free, so.create_time, so.update_time,sc.`name` as scenicName, ms.is_buy, video_url
|
||||||
from member_source ms
|
from member_source ms
|
||||||
left join source so on ms.source_id = so.id
|
left join source so on ms.source_id = so.id
|
||||||
left join scenic sc on sc.id = so.scenic_id
|
|
||||||
where
|
where
|
||||||
ms.member_id = #{memberId} and so.id is not null
|
ms.member_id = #{memberId} and so.id is not null
|
||||||
<if test="scenicId!= null">and ms.scenic_id = #{scenicId} </if>
|
<if test="scenicId!= null">and ms.scenic_id = #{scenicId} </if>
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
select so.id, ms.scenic_id, device_id, url, ms.is_free, video_url, so.create_time, so.update_time,sc.`name` as scenicName, ms.is_buy
|
select so.id, ms.scenic_id, device_id, url, ms.is_free, video_url, so.create_time, so.update_time,sc.`name` as scenicName, ms.is_buy
|
||||||
from member_source ms
|
from member_source ms
|
||||||
left join source so on ms.source_id = so.id
|
left join source so on ms.source_id = so.id
|
||||||
left join scenic sc on sc.id = so.scenic_id
|
|
||||||
where ms.member_id = #{userId} and ms.source_id = #{sourceId} and so.id is not null
|
where ms.member_id = #{userId} and ms.source_id = #{sourceId} and so.id is not null
|
||||||
limit 1
|
limit 1
|
||||||
</select>
|
</select>
|
||||||
@@ -163,7 +163,7 @@
|
|||||||
select so.id, ms.face_id, ms.scenic_id, ms.type, so.url, ms.is_free, so.create_time, so.update_time,sc.`name` as scenicName, ms.is_buy
|
select so.id, ms.face_id, ms.scenic_id, ms.type, so.url, ms.is_free, so.create_time, so.update_time,sc.`name` as scenicName, ms.is_buy
|
||||||
from member_source ms
|
from member_source ms
|
||||||
left join source so on ms.source_id = so.id
|
left join source so on ms.source_id = so.id
|
||||||
left join scenic sc on sc.id = so.scenic_id
|
|
||||||
where
|
where
|
||||||
ms.member_id = #{memberId} and so.id
|
ms.member_id = #{memberId} and so.id
|
||||||
<if test="faceId!= null">and ms.face_id = #{faceId} </if>
|
<if test="faceId!= null">and ms.face_id = #{faceId} </if>
|
||||||
|
@@ -77,8 +77,8 @@
|
|||||||
delete from template_config where id = #{id}
|
delete from template_config where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
<select id="list" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
<select id="list" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
||||||
select t.*, s.name as scenic_name
|
select t.*
|
||||||
from template t left join scenic s on s.id = t.scenic_id
|
from template t
|
||||||
<where>
|
<where>
|
||||||
pid = 0
|
pid = 0
|
||||||
<if test="scenicId!=null" >
|
<if test="scenicId!=null" >
|
||||||
@@ -94,13 +94,13 @@
|
|||||||
order by scenic_id, sort
|
order by scenic_id, sort
|
||||||
</select>
|
</select>
|
||||||
<select id="getById" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
<select id="getById" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
||||||
select t.*, s.name as scenic_name
|
select t.*
|
||||||
from template t left join scenic s on s.id = t.scenic_id
|
from template t
|
||||||
where t.id = #{id}
|
where t.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="getByPid" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
<select id="getByPid" resultType="com.ycwl.basic.model.pc.template.resp.TemplateRespVO">
|
||||||
select t.*, s.name as scenic_name
|
select t.*
|
||||||
from template t left join scenic s on s.id = t.scenic_id
|
from template t
|
||||||
where pid = #{id}
|
where pid = #{id}
|
||||||
order by sort
|
order by sort
|
||||||
</select>
|
</select>
|
||||||
@@ -114,10 +114,10 @@
|
|||||||
order by sort
|
order by sort
|
||||||
</select>
|
</select>
|
||||||
<select id="listFor" resultType="com.ycwl.basic.model.mobile.scenic.content.ContentPageVO">
|
<select id="listFor" resultType="com.ycwl.basic.model.mobile.scenic.content.ContentPageVO">
|
||||||
select t.id templateId, t.scenic_id, s.name as scenic_name, t.`name`, pid, t.cover_url templateCoverUrl,
|
select t.id templateId, t.scenic_id, t.`name`, pid, t.cover_url templateCoverUrl,
|
||||||
0 as sourceType, sort,
|
0 as sourceType, sort,
|
||||||
t.create_time, t.price
|
t.create_time, t.price
|
||||||
from template t left join scenic s on s.id = t.scenic_id
|
from template t
|
||||||
where t.scenic_id = #{scenicId} and pid = 0 and t.status = 1
|
where t.scenic_id = #{scenicId} and pid = 0 and t.status = 1
|
||||||
order by sort
|
order by sort
|
||||||
</select>
|
</select>
|
||||||
|
@@ -77,9 +77,8 @@
|
|||||||
</delete>
|
</delete>
|
||||||
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
<select id="list" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||||
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
||||||
s.name scenicName, s.latitude, s.longitude, t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl
|
t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl
|
||||||
from video v
|
from video v
|
||||||
left join scenic s on s.id = v.scenic_id
|
|
||||||
left join template t on v.template_id = t.id
|
left join template t on v.template_id = t.id
|
||||||
<where>
|
<where>
|
||||||
<if test="scenicId!= null">and v.scenic_id = #{scenicId} </if>
|
<if test="scenicId!= null">and v.scenic_id = #{scenicId} </if>
|
||||||
@@ -99,9 +98,8 @@
|
|||||||
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
<select id="getById" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||||
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
select v.id, v.scenic_id, template_id, task_id, worker_id, video_url, v.create_time, v.update_time,
|
||||||
t.name templateName,t.price templatePrice, t.cover_url templateCoverUrl, t.slash_price slashPrice,
|
t.name templateName,t.price templatePrice, t.cover_url templateCoverUrl, t.slash_price slashPrice,
|
||||||
s.name scenicName, v.height, v.width, v.duration
|
v.height, v.width, v.duration
|
||||||
from video v
|
from video v
|
||||||
left join scenic s on v.scenic_id = s.id
|
|
||||||
left join template t on v.template_id = t.id
|
left join template t on v.template_id = t.id
|
||||||
where v.id = #{id}
|
where v.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
@@ -110,10 +108,9 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="queryByRelation" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
<select id="queryByRelation" resultType="com.ycwl.basic.model.pc.video.resp.VideoRespVO">
|
||||||
select v.id, mv.scenic_id, v.template_id, mv.task_id, mv.face_id, worker_id, video_url, v.create_time, v.update_time,
|
select v.id, mv.scenic_id, v.template_id, mv.task_id, mv.face_id, worker_id, video_url, v.create_time, v.update_time,
|
||||||
s.name scenicName, t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl, mv.is_buy
|
t.name templateName, t.price templatePrice,t.cover_url templateCoverUrl, mv.is_buy
|
||||||
from member_video mv
|
from member_video mv
|
||||||
left join video v on mv.video_id = v.id
|
left join video v on mv.video_id = v.id
|
||||||
left join scenic s on s.id = v.scenic_id
|
|
||||||
left join template t on mv.template_id = t.id
|
left join template t on mv.template_id = t.id
|
||||||
<where>
|
<where>
|
||||||
<if test="scenicId!= null">and mv.scenic_id = #{scenicId} </if>
|
<if test="scenicId!= null">and mv.scenic_id = #{scenicId} </if>
|
||||||
|
Reference in New Issue
Block a user