|
@@ -1,14 +1,18 @@
|
|
|
package org.jeecg.modules.app.service.impl;
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.system.vo.DictModel;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
+import org.jeecg.common.util.DictAnnotationUtil;
|
|
|
import org.jeecg.modules.app.service.IDetailService;
|
|
|
import org.jeecg.modules.app.vo.CourseInfoVO;
|
|
|
import org.jeecg.modules.app.vo.PlaceInfoVO;
|
|
@@ -26,6 +30,7 @@ import org.jeecg.modules.system.mapper.SysDictMapper;
|
|
|
import org.jeecg.modules.system.mapper.SysUserMapper;
|
|
|
import org.jeecg.modules.system.util.PositionUtil;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -62,6 +67,12 @@ public class DetailServiceImpl implements IDetailService {
|
|
|
@Resource
|
|
|
private SysDictMapper sysDictMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private AppInsureMapper appInsureMapper;
|
|
|
+ @Autowired
|
|
|
+ InsurePriceMapper insurePriceMapper;
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public PlaceInfoVO getPlaceInfo(String id) {
|
|
|
AppSite appSite = appSiteMapper.selectById(id);
|
|
@@ -140,6 +151,25 @@ public class DetailServiceImpl implements IDetailService {
|
|
|
BeanUtils.copyProperties(appCourses,courseDetailVO);
|
|
|
courseDetailVOList.add(courseDetailVO);
|
|
|
});
|
|
|
+ if (StringUtils.isNotEmpty(courseInfoVO.getInsureIds())){
|
|
|
+ List<String> aptitudesList = new ArrayList<>();
|
|
|
+ if (courseInfoVO.getInsureIds().indexOf(",")>0){
|
|
|
+ aptitudesList = Arrays.asList(courseInfoVO.getInsureIds().split(","));
|
|
|
+ }else {
|
|
|
+ aptitudesList.add(courseInfoVO.getInsureIds());
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<AppInsure> wrapper = new LambdaQueryWrapper<>();
|
|
|
+ wrapper.in(AppInsure::getId, aptitudesList)
|
|
|
+ .eq(AppInsure::getStatus,0)
|
|
|
+ .eq(AppInsure::getDelFlag,0); // 方法引用 + 集合
|
|
|
+ List<AppInsure> appInsureList = appInsureMapper.selectList(wrapper);
|
|
|
+ DictAnnotationUtil.translateDictList(appInsureList);
|
|
|
+ for (AppInsure appInsure : appInsureList) {
|
|
|
+ List<InsurePrice> insurePrices = insurePriceMapper.selectList(new QueryWrapper<InsurePrice>().lambda().eq(InsurePrice::getInsureId, appInsure.getId()).eq(InsurePrice::getDelFlag, 0));
|
|
|
+ appInsure.setPriceDataList(insurePrices);
|
|
|
+ }
|
|
|
+ courseInfoVO.setInsureIdList(appInsureList);
|
|
|
+ }
|
|
|
|
|
|
courseInfoVO.setCourseDetail(courseDetailVOList);
|
|
|
return courseInfoVO;
|