|
@@ -3,30 +3,43 @@ package org.jeecg.modules.app.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import org.jeecg.modules.app.service.IDetailService;
|
|
|
import org.jeecg.modules.app.vo.PlaceInfoVO;
|
|
|
+import org.jeecg.modules.system.app.entity.AppInstructor;
|
|
|
import org.jeecg.modules.system.app.entity.AppOrderProduct;
|
|
|
import org.jeecg.modules.system.app.entity.AppSite;
|
|
|
import org.jeecg.modules.system.app.entity.AppSitePriceRules;
|
|
|
import org.jeecg.modules.system.app.mapper.*;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
public class DetailServiceImpl implements IDetailService {
|
|
|
@Resource
|
|
|
private AppSiteMapper appSiteMapper;
|
|
|
@Resource
|
|
|
- private AppCoursesMapper appCoursesMapper;
|
|
|
- @Resource
|
|
|
private AppCoursesPriceRulesMapper appCoursesPriceRulesMapper;
|
|
|
@Resource
|
|
|
private AppOrderProductMapper appOrderProductMapper;
|
|
|
@Resource
|
|
|
private AppSitePriceRulesMapper appSitePriceRulesMapper;
|
|
|
+ @Resource
|
|
|
+ private AppInstructorMapper appInstructorMapper;
|
|
|
|
|
|
@Override
|
|
|
public PlaceInfoVO getPlaceInfo(String id) {
|
|
|
AppSite appSite = appSiteMapper.selectById(id);
|
|
|
PlaceInfoVO placeInfo = appSiteMapper.getPlaceInfo(id);
|
|
|
+ List<PlaceInfoVO.InstructorVO> instructorVOList = new ArrayList<>();
|
|
|
+ List<AppInstructor> appInstructors = appInstructorMapper.selectList(Wrappers.<AppInstructor>lambdaQuery()
|
|
|
+ .eq(AppInstructor::getOrgCode, appSite.getOrgCode()));
|
|
|
+ if (appInstructors != null) {
|
|
|
+ for (AppInstructor instructor : appInstructors) {
|
|
|
+ PlaceInfoVO.InstructorVO vo = new PlaceInfoVO.InstructorVO();
|
|
|
+ BeanUtils.copyProperties(vo, instructor); // 注意参数顺序
|
|
|
+ instructorVOList.add(vo);
|
|
|
+ }
|
|
|
+ }
|
|
|
AppSitePriceRules appSitePriceRules = appSitePriceRulesMapper.selectOne(Wrappers.<AppSitePriceRules>lambdaQuery()
|
|
|
.eq(AppSitePriceRules::getSiteId, id)
|
|
|
.eq(AppSitePriceRules::getStatus, 0)
|
|
@@ -36,6 +49,9 @@ public class DetailServiceImpl implements IDetailService {
|
|
|
.setSales(getPlaceSales(id))
|
|
|
.setOriginalPrice(appSitePriceRules.getOriginalPrice())
|
|
|
.setSellingPrice(appSitePriceRules.getSellingPrice());
|
|
|
+ placeInfo.setInstructorVOList(instructorVOList)
|
|
|
+ .setPlaceInfoMsgVO(placeInfoMsgVO);
|
|
|
+ //todo 评价查询待添加
|
|
|
return placeInfo;
|
|
|
}
|
|
|
|